MAC OS ImportError:pycurl:libcurl linktime版本(7.37.1)比compiletime版本(7.43.0)旧

2024-04-29 07:31:32 发布

您现在位置:Python中文网/ 问答频道 /正文

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

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

如何解决?我的系统是约塞米蒂。在


Tags: timeisversion系统错误linkcurlcompile
3条回答

我在塞拉遇到了这个错误。感谢seeliuh在这个issue中的帖子,我在完成以下操作后修复了它:

1.卸载pycurl。在

pip uninstall pycurl

2.导出LD_LIBRARY_PATH=<<your homebrew's libcurl path>>

^{pr2}$

3.重新安装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版本应该大于编译时版本。请检查一下。)

好吧,既然这个答案仍然会出现在Google搜索中,我将分享解决这个问题的方法。在

安装brew版本curl并强制链接以获取最新curl的主要思想:

$ curl --version
curl 7.52.1 (x86_64-apple-darwin16.1.0) libcurl/7.52.1 OpenSSL/1.0.2j zlib/1.2.8 nghttp2/1.18.1

因此,您可以稍后使用pycurl,它链接到您的libcurl和{}

^{pr2}$

希望有帮助!在

对于Ubuntu 18.04

conda install pycurl

相关问题 更多 >