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

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

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

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

解决方法:

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

1.uninstall pycurl.

pip uninstall pycurl

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

export LD_LIBRARY_PATH=/usr/local/opt/curl/lib

export LIBRARY_PATH=/usr/local/opt/curl/lib

3.reinstall pycurl

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

注意:

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的版本应该比编译时版本大.请检查一下.)

上一篇:python – 用PycURL下载图像让我破碎的图像


下一篇:python – 什么是PyCurl的默认超时