安装pycurl报错Could not run curl-config: 'curl-config'

 更新时间:2023年12月13日 10:15:40   作者:ponponon  
这篇文章主要为大家介绍了安装pycurl报错Could not run curl-config: 'curl-config'解决方法,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪

安装报错

Collecting pycurl>=7.45.2 (from trafilatura[all]->-r requirements-prd.txt (line 35))
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/a8/af/24d3acfa76b867dbd8f1166853c18eefc890fc5da03a48672b38ea77ddae/pycurl-7.45.2.tar.gz (234 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 234.2/234.2 kB 41.1 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      Traceback (most recent call last):
        File "/tmp/pip-install-2zlsdu2r/pycurl_41eb25c580f54b42a5b153944f6ca6ea/setup.py", line 229, in configure_unix
          p = subprocess.Popen((self.curl_config(), '--version'),
        File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/usr/lib/python3.10/subprocess.py", line 1863, 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 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-2zlsdu2r/pycurl_41eb25c580f54b42a5b153944f6ca6ea/setup.py", line 970, in <module>
          ext = get_extension(sys.argv, split_extension_source=split_extension_source)
        File "/tmp/pip-install-2zlsdu2r/pycurl_41eb25c580f54b42a5b153944f6ca6ea/setup.py", line 634, in get_extension
          ext_config = ExtensionConfiguration(argv)
        File "/tmp/pip-install-2zlsdu2r/pycurl_41eb25c580f54b42a5b153944f6ca6ea/setup.py", line 93, in __init__
          self.configure()
        File "/tmp/pip-install-2zlsdu2r/pycurl_41eb25c580f54b42a5b153944f6ca6ea/setup.py", line 234, in configure_unix
          raise ConfigurationError(msg)
      __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config'
      [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

怎么解决?

安装下面的依赖即可

sudo apt-get install libcurl4-openssl-dev

如果使用的是官方镜像,比如 python:3.10-bookworm,那么 libcurl4-openssl-dev 已经默认安装了

以上就是安装pycurl报错Could not run curl-config: 'curl-config'的详细内容,更多关于安装pycurl报错的资料请关注脚本之家其它相关文章!

相关文章

  • python rsync服务器之间文件夹同步脚本

    python rsync服务器之间文件夹同步脚本

    这篇文章主要为大家详细介绍了python rsync服务器之间文件夹同步脚本,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2019-08-08
  • Python单元和文档测试实例详解

    Python单元和文档测试实例详解

    这篇文章主要介绍了Python单元和文档测试,结合实例形式分析了Python单元测试模块unittest及文档测试模块doctest相关使用技巧,需要的朋友可以参考下
    2019-04-04
  • 用Python遍历C盘dll文件的方法

    用Python遍历C盘dll文件的方法

    这篇文章主要介绍了用Python遍历C盘dll文件的方法,用fnmatch模块实现起来非常简单,需要的朋友可以参考下
    2015-05-05
  • 详解Python中DOM方法的动态性

    详解Python中DOM方法的动态性

    这篇文章主要介绍了详解Python中DOM方法的动态性,xml.dom模块在Python的网络编程中相当有用,本文来自于IBM官网的开发者技术文档,需要的朋友可以参考下
    2015-04-04
  • 详解用python生成随机数的几种方法

    详解用python生成随机数的几种方法

    这篇文章主要介绍了详解用python生成随机数的几种方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2019-08-08
  • Python装饰器有哪些绝妙的用法

    Python装饰器有哪些绝妙的用法

    本文主要介绍了Python装饰器有哪些绝妙的用法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2022-07-07
  • PyCharm Terminal终端命令行Shell设置方式

    PyCharm Terminal终端命令行Shell设置方式

    这篇文章主要介绍了PyCharm Terminal终端命令行Shell设置方式,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2023-01-01
  • 深入理解python虚拟机GIL详解

    深入理解python虚拟机GIL详解

    在目前的 CPython 当中一直有一个臭名昭著的问题就是 GIL (Global Interpreter Lock ),就是全局解释器锁,他限制了 Python 在多核架构当中的性能,在本篇文章当中我们将详细分析一下 GIL 的利弊和 GIL 的 C 的源代码
    2023-10-10
  • Python连续赋值需要注意的一些问题

    Python连续赋值需要注意的一些问题

    这篇文章主要介绍了Python连续赋值需要注意的一些问题,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2021-06-06
  • python json jsonl 的用法详解

    python json jsonl 的用法详解

    这篇文章主要介绍了python json jsonl 的用法详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2024-08-08

最新评论