Python 3.x 在Mac OSX上安装pymssql和cython失败
我有一个python项目。在项目中,我有requirements.txt文件。在尝试从需求文件安装依赖项时,我发现以下错误。我使用的是mac机器,python 3.6,Cython==0.29.3,pymssql==2.1.4Python 3.x 在Mac OSX上安装pymssql和cython失败,python-3.x,pymssql,Python 3.x,Pymssql,我有一个python项目。在项目中,我有requirements.txt文件。在尝试从需求文件安装依赖项时,我发现以下错误。我使用的是mac机器,python 3.6,Cython==0.29.3,pymssql==2.1.4 ERROR: Command errored out with exit status 1: command: /Users/user_name/.virtualenvs/test/bin/python3.6 -c 'import sys, setuptools, to
ERROR: Command errored out with exit status 1:
command: /Users/user_name/.virtualenvs/test/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/rz/f3lsfyh154s_r7fggcqx57q80000gp/T/pip-install-bz2kcaud/pymssql/setup.py'"'"'; __file__='"'"'/private/var/folders/rz/f3lsfyh154s_r7fggcqx57q80000gp/T/pip-install-bz2kcaud/pymssql/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /private/var/folders/rz/f3lsfyh154s_r7fggcqx57q80000gp/T/pip-install-bz2kcaud/pymssql/
Complete output (7 lines):
/Users/user_name/.virtualenvs/test/lib/python3.6/site-packages/setuptools/dist.py:45: DistDeprecationWarning: Do not call this function
warnings.warn("Do not call this function", DistDeprecationWarning)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/rz/f3lsfyh154s_r7fggcqx57q80000gp/T/pip-install-bz2kcaud/pymssql/setup.py", line 88, in <module>
from Cython.Distutils import build_ext as _build_ext
ModuleNotFoundError: No module named 'Cython'
ERROR: Command errored out with exit status 1: python setup.py
egg_info Check the logs for full command output.
我们可以了解以下步骤
brew install freetds
然后尝试安装requirements.txt文件。
如果仍然出现错误,则遵循。下面是步骤
pip install cython
pip install pymssql
然后再次尝试安装requirements.txt文件