回答

收藏

如何在MacOS Sierra上安装pymssql

技术问答 技术问答 331 人阅读 | 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/! @! P8 b* m' Z, Q
我遇到了与这里显示的错误相同的错误。我试着按brew installfreetds跟随页面上的指示sudo -H pip install pymssql。7 c* _7 R" T" b  B' `# Z
生成此错误代码:" P$ B! R4 }  _( F" Z9 F* w
                _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:. k6 n, s) V% v8 V& f: M
_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
+ M0 d) m& t) Z; A) {7 V, q  \任何帮助都会很棒。
7 K$ ?  |7 c* ^& M8 o/ G                                                                ( @8 o  `: S2 {
    解决方案:                                                               
( R" v3 j& Z2 p  U* B                                                                链接终于解决了我的问题。这个命令序列对其他遇到这些问题的人有用。) v* E" ~: O% B$ h9 z: c
brew uninstall --force freetdsbrew install freetds@0.91brew link --force freetds@0.91pip install pymssql
分享到:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则