для очистки ip прокси python у меня есть запись этот код раньше,
сейчас, когда я хочу запустить его в 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
, поэтому я попытался установить Grab
с помощью этой команды:
pip install Grab
, поэтому я получаю эту ошибку :
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
поэтому я попытался найти это решение :
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
решение этой попытки:
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...
но снова я получаю эту ошибку:
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.
Итак, я спросил здесь для решения.
Спасибо