如何在MacOS Sierra上安装pymssql
技术问答
383 人阅读
|
0 人回复
|
2023-09-14
|
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/7 U& s# G! V; ^) R1 I
我遇到了与这里显示的错误相同的错误。我试着按brew installfreetds跟随页面上的指示sudo -H pip install pymssql。
* q) |" _% {8 {# f8 f0 z( m, k5 c生成此错误代码:1 X& t7 g6 z& L9 ?' Z% ^
_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/搜索这个错误把我带到了这个页面。我也跟着解决方案张贴,通过尝试。brew unlink freetds; brew installhomebrew/versions/freetds091和brew uninstall freetds; brew installhomebrew/versions/freetds091试图犯不同的错误sudo -H pip install pymssql:
- y% a: v3 O4 z5 v- n2 x& J( H_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' filenot found #include sql.h! B8 e& N+ E7 ^! N
任何帮助都会很棒。
3 p6 Z& |" N9 _; G
+ m% G; _% s3 @: U3 a3 C 解决方案: ) u4 k1 ~3 f/ k% V' \: N, U$ L
链接终于解决了我的问题。这个命令序列对其他遇到这些问题的人有用。
' K8 T" S. p2 L( K7 o6 G- b$ j) Mbrew uninstall --force freetdsbrew install freetds@0.91brew link --force freetds@0.91pip install pymssql |
|
|
|
|
|