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

bvjveswy  于 2024-01-06  发布在  Python
关注(0)|答案(1)|浏览(358)

在运行pip install libcurl之后,我一直得到以下输出:

  1. Defaulting to user installation because normal site-packages is not writeable
  2. Collecting pycurl
  3. Using cached pycurl-7.45.2.tar.gz (234 kB)
  4. Preparing metadata (setup.py) ... error
  5. error: subprocess-exited-with-error
  6. × python setup.py egg_info did not run successfully.
  7. exit code: 1
  8. ╰─> [23 lines of output]
  9. Traceback (most recent call last):
  10. File "/tmp/pip-install-02m9ugoh/pycurl_396654a7451a42138d4e279114b11e59/setup.py", line 229, in configure_unix
  11. p = subprocess.Popen((self.curl_config(), '--version'),
  12. File "/usr/lib/python3.10/subprocess.py", line 969, in _init_
  13. self._execute_child(args, executable, preexec_fn, close_fds,
  14. File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
  15. raise child_exception_type(errno_num, err_msg, err_filename)
  16. FileNotFoundError: [Errno 2] No such file or directory: 'curl-config'
  17. During handling of the above exception, another exception occurred:
  18. Traceback (most recent call last):
  19. File "<string>", line 2, in <module>
  20. File "<pip-setuptools-caller>", line 34, in <module>
  21. File "/tmp/pip-install-02m9ugoh/pycurl_396654a7451a42138d4e279114b11e59/setup.py", line 970, in <module>
  22. ext = get_extension(sys.argv, split_extension_source=split_extension_source)
  23. File "/tmp/pip-install-02m9ugoh/pycurl_396654a7451a42138d4e279114b11e59/setup.py", line 634, in get_extension
  24. ext_config = ExtensionConfiguration(argv)
  25. File "/tmp/pip-install-02m9ugoh/pycurl_396654a7451a42138d4e279114b11e59/setup.py", line 93, in _init_
  26. self.configure()
  27. File "/tmp/pip-install-02m9ugoh/pycurl_396654a7451a42138d4e279114b11e59/setup.py", line 234, in configure_unix
  28. raise ConfigurationError(msg)
  29. _main_.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config'
  30. [end of output]
  31. note: This error originates from a subprocess, and is likely not a problem with pip.
  32. error: metadata-generation-failed
  33. × Encountered error while generating package metadata.
  34. ╰─> See above for output.

字符串
我试过安装python-setuptoolsez_setup以及升级setuptoolspip,就像建议的here一样,都无济于事。

lf5gs5x2

lf5gs5x21#

安装Ubuntu包python3-pycurl:apt-get install python3-pycurl

相关问题