简体   繁体   English

用libcurl4导入pycurl会引发ImportError

[英]importing pycurl with libcurl4 raises ImportError

I am using Ubuntu 18.04. 我正在使用Ubuntu 18.04。 If I install libcurl4 (instead of libcurl3), when I import pycurl installed with pipenv I get 如果我安装libcurl4(而不是libcurl3),当我导入通过pipenv安装的pycurl时,我得到

>>> import pycurl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /home/pietro/envs/try_fabric-kcbGLH3z/lib/python3.6/site-packages/pycurl.cpython-36m-x86_64-linux-gnu.so)

Note that this error is raised only when I use a pycurl installed with pipenv or pip. 请注意,仅当我使用安装了pipenv或pip的pycurl时,才会引发此错误。 If I use instead pycurl installed through apt on system python there are any errors... 如果我改为使用通过apt在系统python上安装的pycurl出现任何错误...

What can I do to avoid this impasse? 我该怎么做才能避免这种僵局?

I assume you upgraded your operating system recently. 我假设您最近升级了操作系统。

pip stores a cache of built wheels in your home directory, when upgrading your os it is a good idea to clear this cache as the binaries may now link against incompatible system libraries pip在您的主目录中存储内置车轮的缓存,升级操作系统时,最好清除此缓存,因为二进制文件现在可能链接到不兼容的系统库

You can do this by rm -rf ~/.cache/pip and then recreate your environment 您可以通过rm -rf ~/.cache/pip来执行此操作,然后重新创建环境

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM