简体   繁体   English

在 python 错误中安装抓取(错误:pycurl 的构建轮失败)

[英]Installing grab in python error ( ERROR: Failed building wheel for pycurl)

for scraping proxy ip by python i have writes this code before,为了通过python抓取代理ip,我之前写过这段代码

now when i want to run it in Pycharm i get this error:现在,当我想在 Pycharm 中运行它时,出现此错误:

在此处输入图片说明

/usr/bin/python2.7 /snap/pycharm-community/179/plugins/python-ce/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 38097 --file /media/so/ACAC8B5FAC8B2346/soheil/web_site_root/ieee/all_functions/configs/proxy_scraper/IPProxyScraper.py
pydev debugger: process 4879 is connecting

Connected to pydev debugger (build 193.6494.30)
/media/so/ACAC8B5FAC8B2346/soheil/web_site_root/ieee/all_functions/configs/proxy_scraper/IPProxyScraper.py:402: SyntaxWarning: name 'Html' is assigned to before global declaration
  global Html
Traceback (most recent call last):
  File "/snap/pycharm-community/179/plugins/python-ce/helpers/pydev/pydevd.py", line 1434, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/media/so/ACAC8B5FAC8B2346/soheil/web_site_root/ieee/all_functions/configs/proxy_scraper/IPProxyScraper.py", line 1436, in <module>
    from grab import Grab, GrabError
  File "/snap/pycharm-community/179/plugins/python-ce/helpers/pydev/_pydev_bundle/pydev_monkey_qt.py", line 114, in patched_import
    return original_import(name, *args, **kwargs)
ImportError: No module named grab

Process finished with exit code 1

so i tried to install Grab by this command:所以我尝试通过以下命令安装Grab

pip install Grab

so i get this error:所以我得到这个错误:

so@so-notebook:~$ pip install Grab
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Collecting Grab
  Downloading grab-0.6.41.tar.gz (1.1 MB)
     |████████████████████████████████| 1.1 MB 324 kB/s 
Collecting weblib>=0.1.28
  Downloading weblib-0.1.30.tar.gz (30 kB)
Requirement already satisfied: six in ./.local/lib/python2.7/site-packages (from Grab) (1.14.0)
Collecting user_agent
  Downloading user_agent-0.1.9.tar.gz (20 kB)
Collecting selection
  Downloading selection-0.0.14.tar.gz (4.5 kB)
Collecting defusedxml
  Downloading defusedxml-0.6.0-py2.py3-none-any.whl (23 kB)
Requirement already satisfied: lxml in /usr/lib/python2.7/dist-packages (from Grab) (4.2.1)
Collecting pycurl<7.43.0.2
  Downloading pycurl-7.43.0.1.tar.gz (195 kB)
     |████████████████████████████████| 195 kB 294 kB/s 
Collecting pytils
  Downloading pytils-0.3.tar.gz (89 kB)
     |████████████████████████████████| 89 kB 40 kB/s 
Building wheels for collected packages: Grab, weblib, user-agent, selection, pycurl, pytils
  Building wheel for Grab (setup.py) ... done
  Created wheel for Grab: filename=grab-0.6.41-py2-none-any.whl size=84692 sha256=d25e149fcd2dd10fcc227d65611230d14c72e8170dca0e3c5c9c172be04d7819
  Stored in directory: /home/so/.cache/pip/wheels/bb/e1/45/042902a26abfeaf5226d873a54c7cf1d217a79a49e5b7c426e
  Building wheel for weblib (setup.py) ... done
  Created wheel for weblib: filename=weblib-0.1.30-py2-none-any.whl size=40155 sha256=1b71c64ff447e44658489b7a6e56d5c13ab1d152a160923b6485f0afa2ea5cc3
  Stored in directory: /home/so/.cache/pip/wheels/23/14/c8/3a07d5081237ac96f63aa62fdf27b5d5116fadd54dd12334ca
  Building wheel for user-agent (setup.py) ... done
  Created wheel for user-agent: filename=user_agent-0.1.9-py2-none-any.whl size=18808 sha256=0a991b47c815c1a9cf2dbcbd6079cbfdc7402a3c89c62c64dbf9ce573da52d67
  Stored in directory: /home/so/.cache/pip/wheels/80/f2/c8/a8774eea6f04a748bf24d18ef2f13a38c1aab7f3474295ea36
  Building wheel for selection (setup.py) ... done
  Created wheel for selection: filename=selection-0.0.14-py2-none-any.whl size=5359 sha256=24b573204f3183f84bdbce93cdb1b2bbec8d424c62d2654e97a9d27edf73a1ef
  Stored in directory: /home/so/.cache/pip/wheels/de/b0/7e/8b1c394829407ee80c8374f8e6db819f04c02a2dcbcc424abb
  Building wheel for pycurl (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5QyiMj/pycurl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5QyiMj/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-fDYQM6
       cwd: /tmp/pip-install-5QyiMj/pycurl/
  Complete output (19 lines):
  Using curl-config (libcurl 7.58.0)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/curl
  copying python/curl/__init__.py -> build/lib.linux-x86_64-2.7/curl
  running build_ext
  building 'pycurl' extension
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/src
  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-5Z483E/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPYCURL_VERSION="7.43.0.1" -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/usr/include/python2.7 -c src/docstrings.c -o build/temp.linux-x86_64-2.7/src/docstrings.o
  In file included from src/docstrings.c:4:0:
  src/pycurl.h:164:13: fatal error: openssl/ssl.h: No such file or directory
   #   include <openssl/ssl.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
  Building wheel for pytils (setup.py) ... done
  Created wheel for pytils: filename=pytils-0.3-py2-none-any.whl size=40354 sha256=0354d96d0728eda0c4f76d6a0536f6af7e2ab27b3a26bdb9b76f3a16c920927b
  Stored in directory: /home/so/.cache/pip/wheels/b3/62/11/fa031453d051a69d742f1895e7b76027bc6f7d27f7d5247344
Successfully built Grab weblib user-agent selection pytils
Failed to build pycurl
Installing collected packages: pytils, user-agent, weblib, selection, defusedxml, pycurl, Grab
    Running setup.py install for pycurl ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5QyiMj/pycurl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5QyiMj/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-iKBFOj/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/so/.local/include/python2.7/pycurl
         cwd: /tmp/pip-install-5QyiMj/pycurl/
    Complete output (19 lines):
    Using curl-config (libcurl 7.58.0)
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/curl
    copying python/curl/__init__.py -> build/lib.linux-x86_64-2.7/curl
    running build_ext
    building 'pycurl' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-5Z483E/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPYCURL_VERSION="7.43.0.1" -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/usr/include/python2.7 -c src/docstrings.c -o build/temp.linux-x86_64-2.7/src/docstrings.o
    In file included from src/docstrings.c:4:0:
    src/pycurl.h:164:13: fatal error: openssl/ssl.h: No such file or directory
     #   include <openssl/ssl.h>
                 ^~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-5QyiMj/pycurl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-5QyiMj/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-iKBFOj/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/so/.local/include/python2.7/pycurl Check the logs for full command output.
so@so-notebook:~$ ^C

so i tried to find this solution :所以我试图找到这个解决方案

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

solution by this try:通过这个尝试解决方案:

so@so-notebook:~$ sudo apt-get install python-dev
s[sudo] password for so: 
sa
Sorry, try again.
[sudo] password for so: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-dev is already the newest version (2.7.15~rc1-1).
python-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 74 not upgraded.
so@so-notebook:~$ sudo apt-get install libffi-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libffi-dev is already the newest version (3.2.1-8).
libffi-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 74 not upgraded.
so@so-notebook:~$ sudo apt-get install -y python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 74 not upgraded.
so@so-notebook:~$ sudo apt-get install -y libxml2-dev libxslt1-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libxml2-dev libxslt1-dev
0 upgraded, 2 newly installed, 0 to remove and 74 not upgraded.
Need to get 1,223 kB of archives.
After this operation, 6,003 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 libxml2-dev amd64 2.9.9+dfsg-1+ubuntu18.04.1+deb.sury.org+2 [816 kB]
Get:2 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libxslt1-dev amd64 1.1.29-5ubuntu0.2 [407 kB]
Fetched 1,223 kB in 2s (512 kB/s)                                       
Selecting previously unselected package libxml2-dev:amd64.
(Reading database ... 522047 files and directories currently installed.)
Preparing to unpack .../libxml2-dev_2.9.9+dfsg-1+ubuntu18.04.1+deb.sury.org+2_amd64.deb ...
Unpacking libxml2-dev:amd64 (2.9.9+dfsg-1+ubuntu18.04.1+deb.sury.org+2) ...
Selecting previously unselected package libxslt1-dev:amd64.
Preparing to unpack .../libxslt1-dev_1.1.29-5ubuntu0.2_amd64.deb ...
Unpacking libxslt1-dev:amd64 (1.1.29-5ubuntu0.2) ...
Setting up libxml2-dev:amd64 (2.9.9+dfsg-1+ubuntu18.04.1+deb.sury.org+2) ...
Setting up libxslt1-dev:amd64 (1.1.29-5ubuntu0.2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for doc-base (0.10.8) ...
Processing 1 added doc-base file...
Registering documents with scrollkeeper...

but again i get this error feedback:但我再次收到此错误反馈:


so@so-notebook:~$ pip install Grab
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Processing ./.cache/pip/wheels/bb/e1/45/042902a26abfeaf5226d873a54c7cf1d217a79a49e5b7c426e/grab-0.6.41-py2-none-any.whl
Requirement already satisfied: user-agent in ./.local/lib/python2.7/site-packages (from Grab) (0.1.9)
Requirement already satisfied: lxml; platform_system != "Windows" in /usr/lib/python2.7/dist-packages (from Grab) (4.2.1)
Requirement already satisfied: defusedxml in ./.local/lib/python2.7/site-packages (from Grab) (0.6.0)
Collecting pycurl<7.43.0.2; platform_system != "Windows"
  Using cached pycurl-7.43.0.1.tar.gz (195 kB)
Requirement already satisfied: selection in ./.local/lib/python2.7/site-packages (from Grab) (0.0.14)
Requirement already satisfied: weblib>=0.1.28 in ./.local/lib/python2.7/site-packages (from Grab) (0.1.30)
Requirement already satisfied: six in ./.local/lib/python2.7/site-packages (from Grab) (1.14.0)
Requirement already satisfied: pytils in ./.local/lib/python2.7/site-packages (from weblib>=0.1.28->Grab) (0.3)
Building wheels for collected packages: pycurl
  Building wheel for pycurl (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-LiWg33/pycurl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-LiWg33/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-NAfvHA
       cwd: /tmp/pip-install-LiWg33/pycurl/
  Complete output (19 lines):
  Using curl-config (libcurl 7.58.0)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/curl
  copying python/curl/__init__.py -> build/lib.linux-x86_64-2.7/curl
  running build_ext
  building 'pycurl' extension
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/src
  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-5Z483E/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPYCURL_VERSION="7.43.0.1" -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/usr/include/python2.7 -c src/docstrings.c -o build/temp.linux-x86_64-2.7/src/docstrings.o
  In file included from src/docstrings.c:4:0:
  src/pycurl.h:164:13: fatal error: openssl/ssl.h: No such file or directory
   #   include <openssl/ssl.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, Grab
    Running setup.py install for pycurl ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-LiWg33/pycurl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-LiWg33/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-k5vgol/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/so/.local/include/python2.7/pycurl
         cwd: /tmp/pip-install-LiWg33/pycurl/
    Complete output (19 lines):
    Using curl-config (libcurl 7.58.0)
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/curl
    copying python/curl/__init__.py -> build/lib.linux-x86_64-2.7/curl
    running build_ext
    building 'pycurl' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-5Z483E/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPYCURL_VERSION="7.43.0.1" -DHAVE_CURL_OPENSSL=1 -DHAVE_CURL_SSL=1 -I/usr/include/python2.7 -c src/docstrings.c -o build/temp.linux-x86_64-2.7/src/docstrings.o
    In file included from src/docstrings.c:4:0:
    src/pycurl.h:164:13: fatal error: openssl/ssl.h: No such file or directory
     #   include <openssl/ssl.h>
                 ^~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-LiWg33/pycurl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-LiWg33/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-k5vgol/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/so/.local/include/python2.7/pycurl Check the logs for full command output.


So i asked here for solution.所以我在这里寻求解决方案。

Thanks谢谢

the problem was from pycurl so, i have tried this instruction:问题出在pycurl所以,我试过这个指令:

在此处输入图片说明

I had the same problem.我有同样的问题。 I was able to install it with easy_install instead:我可以使用 easy_install 安装它:

easy_install pycurl easy_install pycurl

For easy_install, see setuptools.对于easy_install,请参阅setuptools。

and then i get htis error:然后我得到 htis 错误:

so@so-notebook:~$ sudo easy_install pycurl
WARNING: The easy_install command is deprecated and will be removed in a future version.
Searching for pycurl
Reading https://pypi.org/simple/pycurl/
Downloading https://files.pythonhosted.org/packages/ef/05/4b773f74f830a90a326b06f9b24e65506302ab049e825a3c0b60b1a6e26a/pycurl-7.43.0.5.tar.gz#sha256=ec7dd291545842295b7b56c12c90ffad2976cc7070c98d7b1517b7b6cd5994b3
Best match: pycurl 7.43.0.5
Processing pycurl-7.43.0.5.tar.gz
Writing /tmp/easy_install-Qb1eoK/pycurl-7.43.0.5/setup.cfg
Running pycurl-7.43.0.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Qb1eoK/pycurl-7.43.0.5/egg-dist-tmp-Vmhx6u
Using curl-config (libcurl 7.58.0)
Using SSL library: GnuTLS
warning: no files found matching 'src/Makefile'
In file included from src/docstrings.c:4:0:
src/pycurl.h:191:13: fatal error: gnutls/gnutls.h: No such file or directory
 #   include <gnutls/gnutls.h>
             ^~~~~~~~~~~~~~~~~
compilation terminated.
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

so i tried this instruction :所以我尝试了这个指令

在此处输入图片说明

by this output:通过这个输出:

so@so-notebook:~$ sudo apt install libcurl4-gnutls-dev librtmp-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libcurl4-gnutls-dev is already the newest version (7.58.0-2ubuntu3.8).
The following additional packages will be installed:
  libgmp-dev libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev
  libgnutlsxx28 libidn2-0-dev libidn2-dev libp11-kit-dev libtasn1-6-dev
  libtasn1-doc nettle-dev
Suggested packages:
  gmp-doc libgmp10-doc libmpfr-dev gnutls-doc gnutls-bin
The following NEW packages will be installed:
  libgmp-dev libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev
  libgnutlsxx28 libidn2-0-dev libidn2-dev libp11-kit-dev librtmp-dev
  libtasn1-6-dev libtasn1-doc nettle-dev
0 upgraded, 13 newly installed, 0 to remove and 74 not upgraded.
Need to get 2,576 kB of archives.
After this operation, 9,778 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libgnutls-openssl27 amd64 3.5.18-1ubuntu1.3 [21.1 kB]
Get:2 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libgnutlsxx28 amd64 3.5.18-1ubuntu1.3 [13.8 kB]
Get:3 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libgnutls-dane0 amd64 3.5.18-1ubuntu1.3 [21.0 kB]
Get:4 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libgnutls28-dev amd64 3.5.18-1ubuntu1.3 [659 kB]
Get:5 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 libidn2-dev amd64 2.2.0-2+ubuntu18.04.1+deb.sury.org+1 [68.0 kB]
Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 libidn2-0-dev amd64 2.2.0-2+ubuntu18.04.1+deb.sury.org+1 [6,276 B]
Get:7 http://ubuntu.parspack.net/ubuntu bionic/main amd64 libgmpxx4ldbl amd64 2:6.1.2+dfsg-2 [8,964 B]
Get:8 http://ubuntu.parspack.net/ubuntu bionic/main amd64 libgmp-dev amd64 2:6.1.2+dfsg-2 [316 kB]
Get:9 http://ubuntu.parspack.net/ubuntu bionic/main amd64 nettle-dev amd64 3.4-1 [951 kB]
Get:10 http://ubuntu.parspack.net/ubuntu bionic/main amd64 libtasn1-6-dev amd64 4.13-2 [86.8 kB]
Get:11 http://ubuntu.parspack.net/ubuntu bionic/main amd64 libp11-kit-dev amd64 0.23.9-2 [60.9 kB]
Get:12 http://ubuntu.parspack.net/ubuntu bionic/main amd64 librtmp-dev amd64 2.4+20151223.gitfa8646d.1-1 [62.1 kB]
Get:13 http://ubuntu.parspack.net/ubuntu bionic/main amd64 libtasn1-doc all 4.13-2 [300 kB]
Fetched 2,576 kB in 4s (655 kB/s)      
Selecting previously unselected package libgmpxx4ldbl:amd64.
(Reading database ... 522257 files and directories currently installed.)
Preparing to unpack .../00-libgmpxx4ldbl_2%3a6.1.2+dfsg-2_amd64.deb ...
Unpacking libgmpxx4ldbl:amd64 (2:6.1.2+dfsg-2) ...
Selecting previously unselected package libgmp-dev:amd64.
Preparing to unpack .../01-libgmp-dev_2%3a6.1.2+dfsg-2_amd64.deb ...
Unpacking libgmp-dev:amd64 (2:6.1.2+dfsg-2) ...
Selecting previously unselected package libgnutls-openssl27:amd64.
Preparing to unpack .../02-libgnutls-openssl27_3.5.18-1ubuntu1.3_amd64.deb ...
Unpacking libgnutls-openssl27:amd64 (3.5.18-1ubuntu1.3) ...
Selecting previously unselected package libgnutlsxx28:amd64.
Preparing to unpack .../03-libgnutlsxx28_3.5.18-1ubuntu1.3_amd64.deb ...
Unpacking libgnutlsxx28:amd64 (3.5.18-1ubuntu1.3) ...
Selecting previously unselected package libgnutls-dane0:amd64.
Preparing to unpack .../04-libgnutls-dane0_3.5.18-1ubuntu1.3_amd64.deb ...
Unpacking libgnutls-dane0:amd64 (3.5.18-1ubuntu1.3) ...
Selecting previously unselected package nettle-dev:amd64.
Preparing to unpack .../05-nettle-dev_3.4-1_amd64.deb ...
Unpacking nettle-dev:amd64 (3.4-1) ...
Selecting previously unselected package libtasn1-6-dev:amd64.
Preparing to unpack .../06-libtasn1-6-dev_4.13-2_amd64.deb ...
Unpacking libtasn1-6-dev:amd64 (4.13-2) ...
Selecting previously unselected package libp11-kit-dev:amd64.
Preparing to unpack .../07-libp11-kit-dev_0.23.9-2_amd64.deb ...
Unpacking libp11-kit-dev:amd64 (0.23.9-2) ...
Selecting previously unselected package libidn2-dev:amd64.
Preparing to unpack .../08-libidn2-dev_2.2.0-2+ubuntu18.04.1+deb.sury.org+1_amd64.deb ...
Unpacking libidn2-dev:amd64 (2.2.0-2+ubuntu18.04.1+deb.sury.org+1) ...
Selecting previously unselected package libidn2-0-dev:amd64.
Preparing to unpack .../09-libidn2-0-dev_2.2.0-2+ubuntu18.04.1+deb.sury.org+1_amd64.deb ...
Unpacking libidn2-0-dev:amd64 (2.2.0-2+ubuntu18.04.1+deb.sury.org+1) ...
Selecting previously unselected package libgnutls28-dev:amd64.
Preparing to unpack .../10-libgnutls28-dev_3.5.18-1ubuntu1.3_amd64.deb ...
Unpacking libgnutls28-dev:amd64 (3.5.18-1ubuntu1.3) ...
Selecting previously unselected package librtmp-dev:amd64.
Preparing to unpack .../11-librtmp-dev_2.4+20151223.gitfa8646d.1-1_amd64.deb ...
Unpacking librtmp-dev:amd64 (2.4+20151223.gitfa8646d.1-1) ...
Selecting previously unselected package libtasn1-doc.
Preparing to unpack .../12-libtasn1-doc_4.13-2_all.deb ...
Unpacking libtasn1-doc (4.13-2) ...
Setting up libp11-kit-dev:amd64 (0.23.9-2) ...
Setting up libtasn1-6-dev:amd64 (4.13-2) ...
Setting up libtasn1-doc (4.13-2) ...
Setting up libgnutlsxx28:amd64 (3.5.18-1ubuntu1.3) ...
Setting up libgnutls-dane0:amd64 (3.5.18-1ubuntu1.3) ...
Setting up libgnutls-openssl27:amd64 (3.5.18-1ubuntu1.3) ...
Setting up libgmpxx4ldbl:amd64 (2:6.1.2+dfsg-2) ...
Setting up libidn2-dev:amd64 (2.2.0-2+ubuntu18.04.1+deb.sury.org+1) ...
Setting up libidn2-0-dev:amd64 (2.2.0-2+ubuntu18.04.1+deb.sury.org+1) ...
Setting up libgmp-dev:amd64 (2:6.1.2+dfsg-2) ...
Setting up nettle-dev:amd64 (3.4-1) ...
Setting up libgnutls28-dev:amd64 (3.5.18-1ubuntu1.3) ...
Setting up librtmp-dev:amd64 (2.4+20151223.gitfa8646d.1-1) ...
Processing triggers for doc-base (0.10.8) ...
Processing 2 added doc-base files...
Registering documents with scrollkeeper...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...

so it solved and installed by :所以它通过以下方式解决安装

so@so-notebook:~$ sudo apt install libcurl4-gnutls-dev librtmp-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libcurl4-gnutls-dev is already the newest version (7.58.0-2ubuntu3.8).
The following additional packages will be installed:
  libgmp-dev libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev
  libgnutlsxx28 libidn2-0-dev libidn2-dev libp11-kit-dev libtasn1-6-dev
  libtasn1-doc nettle-dev
Suggested packages:
  gmp-doc libgmp10-doc libmpfr-dev gnutls-doc gnutls-bin
The following NEW packages will be installed:
  libgmp-dev libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev
  libgnutlsxx28 libidn2-0-dev libidn2-dev libp11-kit-dev librtmp-dev
  libtasn1-6-dev libtasn1-doc nettle-dev
0 upgraded, 13 newly installed, 0 to remove and 74 not upgraded.
Need to get 2,576 kB of archives.
After this operation, 9,778 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libgnutls-openssl27 amd64 3.5.18-1ubuntu1.3 [21.1 kB]
Get:2 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libgnutlsxx28 amd64 3.5.18-1ubuntu1.3 [13.8 kB]
Get:3 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libgnutls-dane0 amd64 3.5.18-1ubuntu1.3 [21.0 kB]
Get:4 http://security.ubuntu.com/ubuntu bionic-security/main amd64 libgnutls28-dev amd64 3.5.18-1ubuntu1.3 [659 kB]
Get:5 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 libidn2-dev amd64 2.2.0-2+ubuntu18.04.1+deb.sury.org+1 [68.0 kB]
Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu bionic/main amd64 libidn2-0-dev amd64 2.2.0-2+ubuntu18.04.1+deb.sury.org+1 [6,276 B]
Get:7 http://ubuntu.parspack.net/ubuntu bionic/main amd64 libgmpxx4ldbl amd64 2:6.1.2+dfsg-2 [8,964 B]
Get:8 http://ubuntu.parspack.net/ubuntu bionic/main amd64 libgmp-dev amd64 2:6.1.2+dfsg-2 [316 kB]
Get:9 http://ubuntu.parspack.net/ubuntu bionic/main amd64 nettle-dev amd64 3.4-1 [951 kB]
Get:10 http://ubuntu.parspack.net/ubuntu bionic/main amd64 libtasn1-6-dev amd64 4.13-2 [86.8 kB]
Get:11 http://ubuntu.parspack.net/ubuntu bionic/main amd64 libp11-kit-dev amd64 0.23.9-2 [60.9 kB]
Get:12 http://ubuntu.parspack.net/ubuntu bionic/main amd64 librtmp-dev amd64 2.4+20151223.gitfa8646d.1-1 [62.1 kB]
Get:13 http://ubuntu.parspack.net/ubuntu bionic/main amd64 libtasn1-doc all 4.13-2 [300 kB]
Fetched 2,576 kB in 4s (655 kB/s)      
Selecting previously unselected package libgmpxx4ldbl:amd64.
(Reading database ... 522257 files and directories currently installed.)
Preparing to unpack .../00-libgmpxx4ldbl_2%3a6.1.2+dfsg-2_amd64.deb ...
Unpacking libgmpxx4ldbl:amd64 (2:6.1.2+dfsg-2) ...
Selecting previously unselected package libgmp-dev:amd64.
Preparing to unpack .../01-libgmp-dev_2%3a6.1.2+dfsg-2_amd64.deb ...
Unpacking libgmp-dev:amd64 (2:6.1.2+dfsg-2) ...
Selecting previously unselected package libgnutls-openssl27:amd64.
Preparing to unpack .../02-libgnutls-openssl27_3.5.18-1ubuntu1.3_amd64.deb ...
Unpacking libgnutls-openssl27:amd64 (3.5.18-1ubuntu1.3) ...
Selecting previously unselected package libgnutlsxx28:amd64.
Preparing to unpack .../03-libgnutlsxx28_3.5.18-1ubuntu1.3_amd64.deb ...
Unpacking libgnutlsxx28:amd64 (3.5.18-1ubuntu1.3) ...
Selecting previously unselected package libgnutls-dane0:amd64.
Preparing to unpack .../04-libgnutls-dane0_3.5.18-1ubuntu1.3_amd64.deb ...
Unpacking libgnutls-dane0:amd64 (3.5.18-1ubuntu1.3) ...
Selecting previously unselected package nettle-dev:amd64.
Preparing to unpack .../05-nettle-dev_3.4-1_amd64.deb ...
Unpacking nettle-dev:amd64 (3.4-1) ...
Selecting previously unselected package libtasn1-6-dev:amd64.
Preparing to unpack .../06-libtasn1-6-dev_4.13-2_amd64.deb ...
Unpacking libtasn1-6-dev:amd64 (4.13-2) ...
Selecting previously unselected package libp11-kit-dev:amd64.
Preparing to unpack .../07-libp11-kit-dev_0.23.9-2_amd64.deb ...
Unpacking libp11-kit-dev:amd64 (0.23.9-2) ...
Selecting previously unselected package libidn2-dev:amd64.
Preparing to unpack .../08-libidn2-dev_2.2.0-2+ubuntu18.04.1+deb.sury.org+1_amd64.deb ...
Unpacking libidn2-dev:amd64 (2.2.0-2+ubuntu18.04.1+deb.sury.org+1) ...
Selecting previously unselected package libidn2-0-dev:amd64.
Preparing to unpack .../09-libidn2-0-dev_2.2.0-2+ubuntu18.04.1+deb.sury.org+1_amd64.deb ...
Unpacking libidn2-0-dev:amd64 (2.2.0-2+ubuntu18.04.1+deb.sury.org+1) ...
Selecting previously unselected package libgnutls28-dev:amd64.
Preparing to unpack .../10-libgnutls28-dev_3.5.18-1ubuntu1.3_amd64.deb ...
Unpacking libgnutls28-dev:amd64 (3.5.18-1ubuntu1.3) ...
Selecting previously unselected package librtmp-dev:amd64.
Preparing to unpack .../11-librtmp-dev_2.4+20151223.gitfa8646d.1-1_amd64.deb ...
Unpacking librtmp-dev:amd64 (2.4+20151223.gitfa8646d.1-1) ...
Selecting previously unselected package libtasn1-doc.
Preparing to unpack .../12-libtasn1-doc_4.13-2_all.deb ...
Unpacking libtasn1-doc (4.13-2) ...
Setting up libp11-kit-dev:amd64 (0.23.9-2) ...
Setting up libtasn1-6-dev:amd64 (4.13-2) ...
Setting up libtasn1-doc (4.13-2) ...
Setting up libgnutlsxx28:amd64 (3.5.18-1ubuntu1.3) ...
Setting up libgnutls-dane0:amd64 (3.5.18-1ubuntu1.3) ...
Setting up libgnutls-openssl27:amd64 (3.5.18-1ubuntu1.3) ...
Setting up libgmpxx4ldbl:amd64 (2:6.1.2+dfsg-2) ...
Setting up libidn2-dev:amd64 (2.2.0-2+ubuntu18.04.1+deb.sury.org+1) ...
Setting up libidn2-0-dev:amd64 (2.2.0-2+ubuntu18.04.1+deb.sury.org+1) ...
Setting up libgmp-dev:amd64 (2:6.1.2+dfsg-2) ...
Setting up nettle-dev:amd64 (3.4-1) ...
Setting up libgnutls28-dev:amd64 (3.5.18-1ubuntu1.3) ...
Setting up librtmp-dev:amd64 (2.4+20151223.gitfa8646d.1-1) ...
Processing triggers for doc-base (0.10.8) ...
Processing 2 added doc-base files...
Registering documents with scrollkeeper...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...


so the problem was from pycurl and solved to install grab like this:所以问题来自pycurl并解决了像这样安装抓取:

so@so-notebook:~$ pip install grab
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Processing ./.cache/pip/wheels/bb/e1/45/042902a26abfeaf5226d873a54c7cf1d217a79a49e5b7c426e/grab-0.6.41-py2-none-any.whl
Requirement already satisfied: user-agent in ./.local/lib/python2.7/site-packages (from grab) (0.1.9)
Requirement already satisfied: lxml; platform_system != "Windows" in /usr/lib/python2.7/dist-packages (from grab) (4.2.1)
Requirement already satisfied: defusedxml in ./.local/lib/python2.7/site-packages (from grab) (0.6.0)
Collecting pycurl<7.43.0.2; platform_system != "Windows"
  Using cached pycurl-7.43.0.1.tar.gz (195 kB)
Requirement already satisfied: selection in ./.local/lib/python2.7/site-packages (from grab) (0.0.14)
Requirement already satisfied: weblib>=0.1.28 in ./.local/lib/python2.7/site-packages (from grab) (0.1.30)
Requirement already satisfied: six in ./.local/lib/python2.7/site-packages (from grab) (1.14.0)
Requirement already satisfied: pytils in ./.local/lib/python2.7/site-packages (from weblib>=0.1.28->grab) (0.3)
Building wheels for collected packages: pycurl
  Building wheel for pycurl (setup.py) ... done
  Created wheel for pycurl: filename=pycurl-7.43.0.1-cp27-cp27mu-linux_x86_64.whl size=205433 sha256=e0a7edce1bfdbe1662a10f1bef2767700e7a07851ff21f369e8930b567587b1a
  Stored in directory: /home/so/.cache/pip/wheels/7f/fb/66/efe2d95478f6d875a1cb0641b40cf8ba649faea9b7a4b0dc7a
Successfully built pycurl
Installing collected packages: pycurl, grab
Successfully installed grab-0.6.41 pycurl-7.43.0.1

sudo apt install librtmp-dev resolved for me. sudo apt install librtmp-dev为我解决了。

My environment:我的环境:

ubuntu conda virtual env ubuntu conda 虚拟环境

My error:我的错误:

Building wheel for python-librtmp (setup.py) ... error
  ERROR: Command errored out with exit status 1:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM