擅长:python、mysql、java
<p>当你得到:<br/>
<code>failed: ImportError: pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (none/other)</code></p>
<p>您需要使用正确设置的pycurl_SSL_库重新编译pycurl。
重新安装似乎是一个两阶段的过程。</p>
<p>pip似乎将这些东西下载到某个地方,编译后放到python可以使用的地方。
如果你在缓存中有编译过的版本,你会被彻底搞砸,因为它不会重新编译。它“给”python同样的东西,不管PYCURL_SSL_LIBRARY变量中是什么。</p>
<p>解决方案非常简单,删除缓存以强制其重新编译。根据操作系统的不同,缓存可能位于多个位置。您可以使用setup.py来搜索它。它包含PACKAGE=“pycurl”字符串。但没必要这么麻烦。最新的pip版本支持install--compile选项。</p>
<p>升级至最新pip:<br/>
<code>pip install --upgrade pip #Healthy anyway</code></p>
<p>使用以下命令删除当前pycurl:<br/>
<code>pip uninstall pycurl</code></p>
<p>根据需要设置PYCURL_SSL_库:<br/>
<code>export PYCURL_SSL_LIBRARY=nss #For me this was the required setting</code></p>
<p>最后运行<br/>
<code>pip install --compile pycurl</code></p>
<p>注意,对于编译过程中需要的各种头文件,可能需要一些-devel包。</p>