2017-07-06 154 views
1
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-J1I0ox/pymssql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qmtdBW-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-J1I0ox/pymssql/ 

我與顯示的here顯示的錯誤相同。我按照brew install freetds後跟sudo -H pip install pymssql的指示在該頁面上進行了操作。如何在MacOS上安裝pymssql Sierra

生成此錯誤代碼:

_mssql.c:18814:15: error: use of undeclared identifier 'DBVERSION_80' 
    __pyx_r = DBVERSION_80; 
      ^
4 warnings and 1 error generated. 
error: command 'cc' failed with exit status 1 

---------------------------------------- 
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-J1I0ox/pymssql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-qmtdBW-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-J1I0ox/pymssql/ 

搜索這個錯誤把我帶到 this page

_mssql.c:266:10: fatal error: 'sqlfront.h' file not found 
#include "sqlfront.h" 
     ^
1 error generated. 
error: command 'cc' failed with exit status 1 

---------------------------------------- 
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/_s/27xppw4j3yl78c9l4v1w3n9m0000gn/T/pip-build-97A9sQ/pymssql/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/_s/27xppw4j3yl78c9l4v1w3n9m0000gn/T/pip-0nUZo4-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/_s/27xppw4j3yl78c9l4v1w3n9m0000gn/T/pip-build-97A9sQ/pymssql/ 

於是我放棄了,並試圖安裝pyodbc,但我仍然得到類似的錯誤:src/pyodbc.h:56:10: fatal error: 'sql.h' file not found #include sql.h

當試圖 sudo -H pip install pymssql我接着嘗試都 brew unlink freetds; brew install homebrew/versions/freetds091brew uninstall freetds; brew install homebrew/versions/freetds091產生不同的錯誤張貼在那裏的解決方案

任何幫助,這將是偉大的。

+0

您是否試圖通過brew安裝'unixodbc'('brew install unixodbc')?它包含你缺少的'sql.h'。 – Zaphod

回答

相關問題