web-dev-qa-db-fra.com

Erreur lors de l'installation de pycurl sur Ubuntu 18.04.

j'ai une erreur lors de l'installation de pycurl, désolé pour un premier message compliqué:

$ pip -v install pycurl


  Downloading from URL https://files.pythonhosted.org/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz#sha256=0f0cdfc7a92d4f2a5c44226162434e34f7d6967d3af416a6f1448649c09a25a4 (from https://pypi.org/simple/pycurl/)
  Running setup.py (path:/tmp/pip-build-ziZ0H2/pycurl/setup.py) Egg_info for package pycurl
    Running command python setup.py Egg_info
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-ziZ0H2/pycurl/setup.py", line 913, in <module>
        ext = get_extension(sys.argv, split_extension_source=split_extension_source)
      File "/tmp/pip-build-ziZ0H2/pycurl/setup.py", line 582, in get_extension
        ext_config = ExtensionConfiguration(argv)
      File "/tmp/pip-build-ziZ0H2/pycurl/setup.py", line 99, in __init__
        self.configure()
      File "/tmp/pip-build-ziZ0H2/pycurl/setup.py", line 227, in configure_unix
        raise ConfigurationError(msg)
    __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory
Cleaning up...
Command "python setup.py Egg_info" failed with error code 1 in /tmp/pip-build-ziZ0H2/pycurl/
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.Finder)
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_Egg_info()
  File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 439, in run_Egg_info
    command_desc='python setup.py Egg_info')
  File "/usr/lib/python2.7/dist-packages/pip/utils/__init__.py", line 725, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command "python setup.py Egg_info" failed with error code 1 in /tmp/pip-build-ziZ0H2/pycurl/

ceci est seulement une partie de l'erreur, c'est trop long pour poster

2
lenovolobo

Je peux recommander d'installer la liaison Python-CURL avec APT:

Sudo apt install python-pycurl

Si vous avez vraiment besoin de l’installer à partir de pip, vous devez d’abord installer le paquet de développement curl (pour que curl-config soit installé):

 Sudo apt install libcurl4-gnutls-dev
2
N0rbert