只是一些开始的信息:
我一直在试着安装pycurl,但是每次我试着运行它,我都会得到:
ImportError: pycurl: libcurl link-time ssl backend (openssl) is different from compile-time ssl backend (none/other)我首先使用安装程序安装pycurl:
python setup.py install它不起作用(因为SSL没有配置)。
在尝试之前,我已经卸载了pycurl (sudo rm -rf /Library/Python/2.7/site-packages/pycurl*):
export PYCURL_SSL_LIBRARY=openssl
easy-install pycurl又一次在尝试之前:
python setup.py --with-ssl install但是,我仍然会得到ssl未编译的相同错误。好像所有的指令都忽略了我的尝试。
安装时setup.py一点也不抱怨,但是在我设置PYCURL_SSL_LIBRARY env之后,轻松安装就会打印这条消息:
src/pycurl.c:151:4: warning: #warning "libcurl was compiled with SSL support, but configure could not determine which " "library was used; thus no SSL crypto locking callbacks will be set, which may " "cause random crashes on SSL requests"这似乎表明它完全无视我刚刚告诉它用openssl安装的事实.
有什么东西是我遗漏的吗?
发布于 2015-04-03 10:11:30
当你得到:
failed: ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (none/other)
您需要正确设置PYCURL_SSL_LIBRARY来重新编译pycurl。重新安装似乎是一个两阶段的过程。
看起来pip会在某个地方下载这些东西,编译它,然后把它放在python可以使用的地方。如果缓存中有编译过的版本,那么您就彻底失败了,因为它不会重新编译。它“给”python同样的东西,而不管PYCURL_SSL_LIBRARY变量中有什么。
解决方案非常简单,删除缓存以强制其重新编译。根据操作系统的不同,缓存可能位于几个位置。您可以使用setup.py这一事实来搜索它。它包含包= "pycurl“字符串。但没有必要有这么多麻烦。最新的pip版本支持安装-编译选项。
升级到最新的pip:
pip install --upgrade pip #Healthy anyway
使用以下方法移除当前的pycurl:
pip uninstall pycurl
根据需要设置PYCURL_SSL_LIBRARY:
export PYCURL_SSL_LIBRARY=nss #For me this was the required setting
终于跑了
pip install --compile pycurl
请注意,对于编译过程中需要的各种头文件,您可能需要一些-devel包。
发布于 2017-06-22 02:23:44
我必须在CentOS 7上使用以下内容:
sudo pip install --no-cache-dir --compile --ignore-installed --install-option="--with-nss" pycurl
不需要uninstall或设置PYCURL_SSL_LIBRARY。所有的东西都被烤成了一条线。
发布于 2018-03-22 03:09:47
对于mac,sudo pip install -无缓存dir-编译
https://stackoverflow.com/questions/21487278
复制相似问题