我在iMac上运行MacOS 10.11.6(El Capitan)。我建立了一个Python 3.4.7虚拟环境,并且我已经安装了各种软件包,包括numpy,pandas,scipy等。但是,我很难安装pymssql。我知道我需要首先安装FreeTDS,并且我已经使用fink(它安装了freetds版本0.91-5)来完成此操作。然而,当我启动一个虚拟的环境和运行:使用pip安装pymssql失败并链接到使用Mac上的fink安装的FreeTDS
pip install pymssql
我收到以下错误消息(道歉它的大小):使用自制安装freetds的
Collecting pymssql
Using cached pymssql-2.1.3.tar.gz
Complete output from command python setup.py egg_info:
Download error on https://pypi.python.org/simple/setuptools_git/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600) -- Some packages may not be found!
Download error on https://pypi.python.org/simple/setuptools-git/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600) -- Some packages may not be found!
Couldn't find index page for 'setuptools_git' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600) -- Some packages may not be found!
No local packages or working download links found for setuptools_git
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/75/qtnqhywh8xj9760059b8dbd80000gq/T/pip-build-pyxahulz/pymssql/setup.py", line 477, in <module>
ext_modules = ext_modules(),
File "/Users/xyz/Documents/python_projects/general_python34_projects/env34/lib/python3.4/site-packages/setuptools/__init__.py", line 128, in setup
_install_setup_requires(attrs)
File "/Users/xyz/Documents/python_projects/general_python34_projects/env34/lib/python3.4/site-packages/setuptools/__init__.py", line 123, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/Users/xyz/Documents/python_projects/general_python34_projects/env34/lib/python3.4/site-packages/setuptools/dist.py", line 453, in fetch_build_eggs
replace_conflicting=True,
File "/Users/xyz/Documents/python_projects/general_python34_projects/env34/lib/python3.4/site-packages/pkg_resources/__init__.py", line 866, in resolve
replace_conflicting=replace_conflicting
File "/Users/xyz/Documents/python_projects/general_python34_projects/env34/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1146, in best_match
return self.obtain(req, installer)
File "/Users/xyz/Documents/python_projects/general_python34_projects/env34/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1158, in obtain
return installer(requirement)
File "/Users/xyz/Documents/python_projects/general_python34_projects/env34/lib/python3.4/site-packages/setuptools/dist.py", line 520, in fetch_build_egg
return cmd.easy_install(req)
File "/Users/xyz/Documents/python_projects/general_python34_projects/env34/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 666, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('setuptools_git')
setup.py: platform.system() => 'Darwin'
setup.py: platform.architecture() => ('64bit', '')
setup.py: platform.libc_ver() => ('', '')
setup.py: Detected Darwin/Mac OS X.
You can install FreeTDS with Homebrew or MacPorts, or by downloading
and compiling it yourself.
Homebrew (http://brew.sh/)
--------------------------
brew install freetds
MacPorts (http://www.macports.org/)
-----------------------------------
sudo port install freetds
setup.py: Not using bundled FreeTDS
setup.py: include_dirs = ['/sw/include']
setup.py: library_dirs = ['/usr/local/lib', '/sw/lib', '/opt/local/lib']
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/75/qtnqhywh8xj9760059b8dbd80000gq/T/pip-build-pyxahulz/pymssql/
网上说明介绍但我一直使用fink,不想与两个系统安装的代码产生冲突。
我已经更新了fink和pip,并且安装了最新的setuptools。
我试着运行:
pip install --global-option=build_ext --global-option="-L/sw/lib" --global-option="-I/sw/include" pymssql
...但没有运气。
我也尝试安装pymssql的早期版本:
pip install pymssql==2.1.1
同样,没有喜悦。
或者是错误输出密钥开始处的'证书验证失败'注释?
我确定我以前在其他机器上安装过MSSQL,我不记得有任何问题。我也不记得我做了什么不同(如果有的话)。
任何人都可以帮助我解决这个问题,请。