pip install pycurl schlägt unter Ubuntu 18.04 fehl

pip install pycurl schlägt unter Ubuntu 18.04 fehl

Ich möchte Python 3.7 auf Ubuntu 18.04 installieren. Python3.7 von „deadsnakes“ installiert pycurl.pip

Von apt-cache depends python-pycurlbekomme ich:

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

Dann habe ich folgendes installiert:

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

Ich habe dann versucht:

pip install pycurl

Ich habe:

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/

Nach der Installation 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/

Antwort1

Nach einigen Iterationen stellte sich heraus, dass zum Kompilieren einige Entwicklungspakete fehlten pycurl.

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

Der wesentliche Hinweis hierzu libpython3.7-devlautet wie folgt.

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

Dies zeigt an, dass Python.hfehlt oder nicht gefunden werden kann. In diesem Fall ist es etwas schwierig, das entsprechende Paket zu finden, da viele Pakete diese Datei bereitstellen. Sie können verwenden

apt-file search Python.h

um nach Paketen zu suchen, die diese Datei bereitstellen. Da Sie versuchen, das Paket mit dem vom System bereitgestellten Python 3.7 zu kompilieren, sollte es auch einen Namen wie „ libpythonmit Versionsangabe“ haben.


Der zweite Hinweis lautet wie folgt.

/usr/bin/ld: cannot find -lssl3

Dies zeigt Ihnen, dass der Linker die libssl3.soBibliothek, mit der die neu kompilierten pycurlObjekte verknüpft werden sollen, nicht finden kann. Sie können auch verwenden, apt-file searchum Pakete zu finden, die diese Bibliothek bereitstellen. Ich bin nicht sicher, ob das -devPaket hier auch benötigt wird, aber es sollte keine Rolle spielen, wenn Sie es einfach ebenfalls installieren.

Antwort2

Dies ist ein alter Thread, und frühere Lösungen haben bei mir nicht funktioniert. Und ich musste den Pfad für OpenSSL ändern. Ich kommentiere es hier, ich glaube, es könnte jemandem Zeit sparen. Maschine, die ich verwende

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

verwandte Informationen