pip install pycurl falla en Ubuntu 18.04

pip install pycurl falla en Ubuntu 18.04

Quiero instalar pycurlusando pipPython 3.7 en Ubuntu 18.04. Python3.7 instalado desde "deadsnakes".

De apt-cache depends python-pycurlobtengo:

python-pycurl
  Depends: python
  Depends: python
  Depends: <python:any>
    python:i386
    python
  Depends: <python:any>
    python:i386
    python
  Depends: libc6
  Depends: libcurl3-gnutls
  Suggests: libcurl4-gnutls-dev
  Suggests: python-pycurl-dbg
  Suggests: python-pycurl-doc

Luego instalé lo siguiente:

sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install python-pycurl-dbg
sudo apt-get install python-pycurl-doc

Luego intenté:

pip install pycurl

Obtuve:

Collecting pycurl
  Using cached https://files.pythonhosted.org/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz
Building wheels for collected packages: pycurl
  Building wheel for pycurl (setup.py) ... error
  ERROR: Complete output from command /usr/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-de7mbdj3/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-85pj90gy --python-tag cp37:
  ERROR: Using curl-config (libcurl 7.58.0)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/curl
  copying python/curl/__init__.py -> build/lib.linux-x86_64-3.7/curl
  running build_ext
  building 'pycurl' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/docstrings.c -o build/temp.linux-x86_64-3.7/src/docstrings.o
  In file included from src/docstrings.c:4:0:
  src/pycurl.h:4:10: fatal error: Python.h: No such file or directory
   #include <Python.h>
            ^~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pycurl
  Running setup.py clean for pycurl
Failed to build pycurl
Installing collected packages: pycurl
  Running setup.py install for pycurl ... error
    ERROR: Complete output from command /usr/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-de7mbdj3/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0n2ynluk/install-record.txt --single-version-externally-managed --compile:
    ERROR: Using curl-config (libcurl 7.58.0)
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/curl
    copying python/curl/__init__.py -> build/lib.linux-x86_64-3.7/curl
    running build_ext
    building 'pycurl' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/docstrings.c -o build/temp.linux-x86_64-3.7/src/docstrings.o
    In file included from src/docstrings.c:4:0:
    src/pycurl.h:4:10: fatal error: Python.h: No such file or directory
     #include <Python.h>
              ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-de7mbdj3/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-0n2ynluk/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-de7mbdj3/pycurl/

Después de instalar libpython3.7-dev:

Collecting pycurl
  Using cached https://files.pythonhosted.org/packages/e8/e4/0dbb8735407189f00b33d84122b9be52c790c7c3b25286826f4e1bdb7bde/pycurl-7.43.0.2.tar.gz
Building wheels for collected packages: pycurl
  Building wheel for pycurl (setup.py) ... error
  ERROR: Complete output from command /usr/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-ww9s3047/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-t5aeuzkr --python-tag cp37:
  ERROR: Using curl-config (libcurl 7.58.0)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/curl
  copying python/curl/__init__.py -> build/lib.linux-x86_64-3.7/curl
  running build_ext
  building 'pycurl' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/src
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/docstrings.c -o build/temp.linux-x86_64-3.7/src/docstrings.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/easy.c -o build/temp.linux-x86_64-3.7/src/easy.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/easycb.c -o build/temp.linux-x86_64-3.7/src/easycb.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/easyinfo.c -o build/temp.linux-x86_64-3.7/src/easyinfo.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/easyopt.c -o build/temp.linux-x86_64-3.7/src/easyopt.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/easyperform.c -o build/temp.linux-x86_64-3.7/src/easyperform.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/module.c -o build/temp.linux-x86_64-3.7/src/module.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/multi.c -o build/temp.linux-x86_64-3.7/src/multi.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/oscompat.c -o build/temp.linux-x86_64-3.7/src/oscompat.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/pythoncompat.c -o build/temp.linux-x86_64-3.7/src/pythoncompat.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/share.c -o build/temp.linux-x86_64-3.7/src/share.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/stringcompat.c -o build/temp.linux-x86_64-3.7/src/stringcompat.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/threadsupport.c -o build/temp.linux-x86_64-3.7/src/threadsupport.o
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/util.c -o build/temp.linux-x86_64-3.7/src/util.o
  x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.7/src/docstrings.o build/temp.linux-x86_64-3.7/src/easy.o build/temp.linux-x86_64-3.7/src/easycb.o build/temp.linux-x86_64-3.7/src/easyinfo.o build/temp.linux-x86_64-3.7/src/easyopt.o build/temp.linux-x86_64-3.7/src/easyperform.o build/temp.linux-x86_64-3.7/src/module.o build/temp.linux-x86_64-3.7/src/multi.o build/temp.linux-x86_64-3.7/src/oscompat.o build/temp.linux-x86_64-3.7/src/pythoncompat.o build/temp.linux-x86_64-3.7/src/share.o build/temp.linux-x86_64-3.7/src/stringcompat.o build/temp.linux-x86_64-3.7/src/threadsupport.o build/temp.linux-x86_64-3.7/src/util.o -lssl3 -lcurl -o build/lib.linux-x86_64-3.7/pycurl.cpython-37m-x86_64-linux-gnu.so
  /usr/bin/ld: cannot find -lssl3
  collect2: error: ld returned 1 exit status
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pycurl
  Running setup.py clean for pycurl
Failed to build pycurl
Installing collected packages: pycurl
  Running setup.py install for pycurl ... error
    ERROR: Complete output from command /usr/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-ww9s3047/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-obgqqm_m/install-record.txt --single-version-externally-managed --compile:
    ERROR: Using curl-config (libcurl 7.58.0)
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/curl
    copying python/curl/__init__.py -> build/lib.linux-x86_64-3.7/curl
    running build_ext
    building 'pycurl' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/docstrings.c -o build/temp.linux-x86_64-3.7/src/docstrings.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/easy.c -o build/temp.linux-x86_64-3.7/src/easy.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/easycb.c -o build/temp.linux-x86_64-3.7/src/easycb.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/easyinfo.c -o build/temp.linux-x86_64-3.7/src/easyinfo.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/easyopt.c -o build/temp.linux-x86_64-3.7/src/easyopt.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/easyperform.c -o build/temp.linux-x86_64-3.7/src/easyperform.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/module.c -o build/temp.linux-x86_64-3.7/src/module.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/multi.c -o build/temp.linux-x86_64-3.7/src/multi.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/oscompat.c -o build/temp.linux-x86_64-3.7/src/oscompat.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/pythoncompat.c -o build/temp.linux-x86_64-3.7/src/pythoncompat.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/share.c -o build/temp.linux-x86_64-3.7/src/share.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/stringcompat.c -o build/temp.linux-x86_64-3.7/src/stringcompat.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/threadsupport.c -o build/temp.linux-x86_64-3.7/src/threadsupport.o
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPYCURL_VERSION="7.43.0.2" -DHAVE_CURL_SSL=1 -DHAVE_CURL_NSS=1 -DHAVE_CURL_SSL=1 -I/usr/include/python3.7m -c src/util.c -o build/temp.linux-x86_64-3.7/src/util.o
    x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.7-0Cmdei/python3.7-3.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.7/src/docstrings.o build/temp.linux-x86_64-3.7/src/easy.o build/temp.linux-x86_64-3.7/src/easycb.o build/temp.linux-x86_64-3.7/src/easyinfo.o build/temp.linux-x86_64-3.7/src/easyopt.o build/temp.linux-x86_64-3.7/src/easyperform.o build/temp.linux-x86_64-3.7/src/module.o build/temp.linux-x86_64-3.7/src/multi.o build/temp.linux-x86_64-3.7/src/oscompat.o build/temp.linux-x86_64-3.7/src/pythoncompat.o build/temp.linux-x86_64-3.7/src/share.o build/temp.linux-x86_64-3.7/src/stringcompat.o build/temp.linux-x86_64-3.7/src/threadsupport.o build/temp.linux-x86_64-3.7/src/util.o -lssl3 -lcurl -o build/lib.linux-x86_64-3.7/pycurl.cpython-37m-x86_64-linux-gnu.so
    /usr/bin/ld: cannot find -lssl3
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-ww9s3047/pycurl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-obgqqm_m/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-ww9s3047/pycurl/

Respuesta1

Después de algunas iteraciones resultó que faltaban algunos paquetes de desarrollo para compilar pycurl.

apt-get install libpython3.7-dev libnss3 libnss3-dev

La sugerencia esencial libpython3.7-deves la siguiente.

src/pycurl.h:4:10: fatal error: Python.h: No such file or directory 

Esto indica que Python.hfalta o no se puede encontrar. En este caso es un poco difícil encontrar el paquete correspondiente ya que muchos paquetes proporcionan este archivo. Puedes usar

apt-file search Python.h

para buscar paquetes que proporcionen este archivo. Dado que está intentando compilar con el sistema proporcionado Python 3.7 el paquete, también debe tener un nombre parecido libpythona incluir la versión.


La segunda pista es la siguiente.

/usr/bin/ld: cannot find -lssl3

Esto le indica que el vinculador no puede encontrar la libssl3.sobiblioteca para vincular los pycurlobjetos compilados nuevos. También puede utilizar apt-file searchpara buscar paquetes que proporcionen esta biblioteca. No estoy seguro si el -devpaquete también es necesario aquí, pero no debería importar si lo instalas también.

Respuesta2

Este es un hilo antiguo y las soluciones anteriores no me funcionaron. Y tuve que cambiar la ruta para openssl. Lo estoy comentando aquí, creo que podría ahorrarle tiempo a alguien. maquina que estoy usando

MacOS: Apple M1 Pro (Ventura v13.4)

pip uninstall pycurl
PYCURL_SSL_LIBRARY=openssl LDFLAGS="-L/opt/homebrew/opt/openssl/lib" CPPFLAGS="-I/opt/homebrew/opt/openssl/include" pip install --no-cache-dir pycurl

información relacionada