Python 3.10.6 (Ubuntu 22.04.2) 上的 pycURL 安装错误

问题描述 投票:0回答:1

运行

pip install libcurl
后,我不断得到以下输出:

Defaulting to user installation because normal site-packages is not writeable
Collecting pycurl
  Using cached pycurl-7.45.2.tar.gz (234 kB)
  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-02m9ugoh/pycurl_396654a7451a42138d4e279114b11e59/setup.py", line 229, in configure_unix
          p = subprocess.Popen((self.curl_config(), '--version'),
        File "/usr/lib/python3.10/subprocess.py", line 969, in _init_
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/usr/lib/python3.10/subprocess.py", line 1845, 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-02m9ugoh/pycurl_396654a7451a42138d4e279114b11e59/setup.py", line 970, in <module>
          ext = get_extension(sys.argv, split_extension_source=split_extension_source)
        File "/tmp/pip-install-02m9ugoh/pycurl_396654a7451a42138d4e279114b11e59/setup.py", line 634, in get_extension
          ext_config = ExtensionConfiguration(argv)
        File "/tmp/pip-install-02m9ugoh/pycurl_396654a7451a42138d4e279114b11e59/setup.py", line 93, in _init_
          self.configure()
        File "/tmp/pip-install-02m9ugoh/pycurl_396654a7451a42138d4e279114b11e59/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.

我尝试按照

here
的建议安装
python-setuptools
ez_setup
以及升级
setuptools
pip,但都无济于事。

python python-3.x ubuntu pycurl ubuntu-22.04
1个回答
0
投票

安装ubuntu包python3-pycurl: apt-get 安装 python3-pycurl

© www.soinside.com 2019 - 2024. All rights reserved.