问题描述
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 install freetds
,再按sudo -H pip install pymssql
.
I am having the same error as displayed here . I followed the instructions on that page by trying brew install freetds
followed by sudo -H pip install pymssql
.
这将产生此错误代码:
_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 install homebrew/versions/freetds091
和 brew uninstall freetds; brew install homebrew/versions/freetds091
的方法来解决那里发布的解决方案,当尝试 sudo -H pip install pymssql
时会产生不同的错误:
Searching this error brought me to this page. I followed the solution posted there by trying both brew unlink freetds; brew install homebrew/versions/freetds091
and brew uninstall freetds; brew install homebrew/versions/freetds091
which generates a different error when trying sudo -H pip install pymssql
:
_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
So then I gave up and tried to install pyodbc, but I still get similar errors: src/pyodbc.h:56:10: fatal error: 'sql.h' file not found #include sql.h
任何对此的帮助都会很棒.
Any help with this would be great.
推荐答案
此链接最终解决了我的问题.对于遇到这些问题的其他人,此命令序列对我有用.
This link ended up solving my problem. For anyone else having these issues, this sequence of commands worked for me.
brew uninstall --force freetds
brew install [email protected]
brew link --force [email protected]
pip install pymssql
这篇关于如何在MacOS Sierra上安装pymssql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!