当前位置:首页 > 操作系统 > MacOs

python – MAC OS ImportError:pycurl:libcurl链接时版本(7.37.1)早于编译时版本(7.43.0)

当我在python接口中导入curl时,它显示错误

<code>ImportError: pycurl: libcurl link-time version (7.37.1) is older than compile-time version (7.43.0).
</code>

怎么解决?我的系统是优胜美地.

解决方法:

我在Sierra遇到了这个错误.感谢seeliuh在这个issue的帖子,我做了以下修复:

1.uninstall pycurl.

<code>pip uninstall pycurl
</code>

2.export LD_LIBRARY_PATH =<< your homebrew的libcurl path>>

<code>export LD_LIBRARY_PATH=/usr/local/opt/curl/lib

export LIBRARY_PATH=/usr/local/opt/curl/lib
</code>

3.reinstall pycurl

<code>easy_install pycurl # you also can try to use pip though using it here probably would cause some problems
</code>

注意:

PycURL documentation指出:

If libcurl is linked dynamically with pycurl, you may have to alter the LD_LIBRARY_PATH environment variable accordingly. This normally applies only if there is more than one version of libcurl installed, e.g. one in /usr/lib and one in /usr/local/lib.

因此,您应该将LD_LIBRARY_PATH更改为自制软件的libcurl路径. (你的自制软件libcurl的版本应该比编译时版本大.请检查一下.)


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐