微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法在 Python 3.8.8 上安装 PyCurl 7.43.0.6 | RHEL 8.3

如何解决无法在 Python 3.8.8 上安装 PyCurl 7.43.0.6 | RHEL 8.3

工作站详细信息:

  • RHEL 8.3 - x86_64
  • Python 3.8.8
  • libcurl 7.61.1-14.el8_3.1

我试过了

pip install pycurl==7.43.0.6

错误[回溯]:

ERROR: Command errored out with exit status 1:
 command: /home/raa/Projects/venv/test55/bin/python -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/tmp/pip-install-s049piq0/pycurl_e1573e1fea9a47e5a16d1e71517e3013/setup.py'"'"'; __file__='"'"'/tmp/pip-install-s049piq0/pycurl_e1573e1fea9a47e5a16d1e71517e3013/setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-46mx471v
     cwd: /tmp/pip-install-s049piq0/pycurl_e1573e1fea9a47e5a16d1e71517e3013/
Complete output (22 lines):
Traceback (most recent call last):
  File "/tmp/pip-install-s049piq0/pycurl_e1573e1fea9a47e5a16d1e71517e3013/setup.py",line 236,in configure_unix
    p = subprocess.Popen((self.curl_config(),'--version'),File "/usr/local/lib/python3.8/subprocess.py",line 858,in __init__
    self._execute_child(args,executable,preexec_fn,close_fds,line 1706,in _execute_child
    raise child_exception_type(errno_num,err_msg,err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'curl-config'

During handling of the above exception,another exception occurred:

Traceback (most recent call last):
  File "<string>",line 1,in <module>
  File "/tmp/pip-install-s049piq0/pycurl_e1573e1fea9a47e5a16d1e71517e3013/setup.py",line 988,in <module>
    ext = get_extension(sys.argv,split_extension_source=split_extension_source)
  File "/tmp/pip-install-s049piq0/pycurl_e1573e1fea9a47e5a16d1e71517e3013/setup.py",line 649,in get_extension
    ext_config = ExtensionConfiguration(argv)
  File "/tmp/pip-install-s049piq0/pycurl_e1573e1fea9a47e5a16d1e71517e3013/setup.py",line 101,in __init__
    self.configure()
  File "/tmp/pip-install-s049piq0/pycurl_e1573e1fea9a47e5a16d1e71517e3013/setup.py",line 241,in configure_unix
    raise ConfigurationError(msg)
__main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config'
----------------------------------------
WARNING: discarding https://files.pythonhosted.org/packages/50/1a/35b1d8b8e4e23a234f1b17a8a40299fd550940b16866c9a1f2d47a04b969/pycurl-7.43.0.6.tar.gz#sha256=8301518689daefa53726b59ded6b48f33751c383cf987b0ccfbbc4ed40281325 (from https://pypi.org/simple/pycurl/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pycurl==7.43.0.6
ERROR: No matching distribution found for pycurl==7.43.0.6

请帮忙。

解决方法

错误来源与Python或pycurl包无关。这是由于 RHEL 上缺少 libcurl-devel

错误信息/引用没有明确提到这一点。

在 RHEL 8 中,我使用 sudo dnf install libcurl-devel 安装了该库。

后来,pip install pycurl==7.43.0.6 解决了这个问题。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。