I am trying to install Scrapy from the command line and getting the following error.
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\paran\appdata\local\programs\python\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\paran\\AppData\\Local\\Temp\\pip-install-sa3_a6ft\\Twisted\\setup.py'"'"'; __file__='"'"'C:\\Users\\paran\\AppData\\Local\\Temp\\pip-install-sa3_a6ft\\Twisted\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\paran\AppData\Local\Temp\pip-record-egqr0bb7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\paran\appdata\local\programs\python\python38\Include\Twisted'
If you see the installation guide it's recommended to install Scrapy with anaconda or miniconda. Installing scrapy on Windows using pip is a headache.
I installed it right now at my office pc running on windows 10 using pip to test it:
win10, python 3.7
manually download twisted from
https://www.lfd.uci.edu/~gohlke/pythonlibs/
choose the version and download Twisted-18.7.0-cp35-cp35m-win_amd64.whl
cd to files download directory
pip install Twisted-18.7.0-cp35-cp35m-win_amd64.whl
pip install scrapy
pip install pypiwin32
In windows Scrapy required some dependencies before installation please read this
https://docs.scrapy.org/en/latest/intro/install.html
There is also another way to install Scrapy in windows using anaconda
Related
I have python installed on windows server without internet connection.
Now I want to connect to the SQL Server database on the server via python and therefore wanted to install PyODBC.
I downloaded pyodbc-4.0.17.tar.gz from their website from local windows with internet connection, uploaded to the server and tried to install it through the command line via pip install, but get the following error message:
ERROR: Command errored out with exit status 1:
command: 'c:\users\a2289770-3\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tok
enize; sys.argv[0] = '"'"'C:\\Users\\A22897~1\\AppData\\Local\\Temp\\3\\pip-req-build-agil8hty\\setup.py'"'"'; __file__=
'"'"'C:\\Users\\A22897~1\\AppData\\Local\\Temp\\3\\pip-req-build-agil8hty\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"
'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exe
c'"'"'))' install --record 'C:\Users\A22897~1\AppData\Local\Temp\3\pip-record-hfui07d3\install-record.txt' --single-vers
ion-externally-managed --compile --install-headers 'c:\users\a2289770-3\appdata\local\programs\python\python37\Include\p
yodbc'
cwd: C:\Users\A22897~1\AppData\Local\Temp\3\pip-req-build-agil8hty\
Complete output (5 lines):
running install
running build
running build_ext
building 'pyodbc' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.micr
osoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\a2289770-3\appdata\local\programs\python\python37\python.exe' -
u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\A22897~1\\AppData\\Local\\Temp\\3\\pip-req-build-a
gil8hty\\setup.py'"'"'; __file__='"'"'C:\\Users\\A22897~1\\AppData\\Local\\Temp\\3\\pip-req-build-agil8hty\\setup.py'"'"
';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec
(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\A22897~1\AppData\Local\Temp\3\pip-record-hfui07d3\
install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\a2289770-3\appdata\local\p
rograms\python\python37\Include\pyodbc' Check the logs for full command output.
So I tried to install Visual C++ 14 but all the installation packages that I tried try to connect to the internet and therefore stop during the installation process.
Can anyone help out here?
Ok I found a solution here: How to install packages offline?
creating requirements.txt including all needed packages via pip freeze > requirements.txt
Downloading all packages and their dependencies into a directory on local windows with internet connection - also including requirements.txt there (in my case "wheelhouse" via pip download, see link for details)
upload that directory onto the Server
installing with the following command
pip install -r wheelhouse/requirements.txt --no-index --find-links wheelhouse
Now I can use pyodbc on the offline server.
I find it strange that it required Microsoft Visual C++ 14.0 before and works now without me having installed it but whatever... if anyone knows the reason for this I would be interested to read it in the comments.
I've installed a separated python version and activated virtual environment based on it , on CentOs7 when i use the pip install method from offline packages i got this error :
ERROR: Command errored out with exit status 127:
command: /home/awagdy/Documents/reporter-web/venv/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jlfbivgb/Django/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jlfbivgb/Django/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-jlfbivgb/Django/
Complete output (1 lines):
/home/awagdy/Documents/reporter-web/venv/bin/python3.7: error while loading shared libraries: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
----------------------------------------
ERROR: Command errored out with exit status 127: python setup.py egg_info Check the logs for full command output.
I'm installing from a folder that contains the needed packages downloaded using the command pip download , then installing them offline using pip install -r requirements.txt --no--index --find-links=pkgs
The link below, the person suggests using
easy_install when installing python packages in a virtual environment
example
Using this command helped path/to/python/python3.6 -m pip install -r requirements.txt --no-index --find-links=path/to/pkgs
I am trying to get ansible installed in venv in Python 3.8 in Windows 10.
I have tried:
pip install -U setuptools
pip3 install ansible
pip install –user
So far that has not worked.
I am getting error:
ERROR: Command errored out with exit status 1: 'c:\users\XXXXXXX\python\test_env\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\XXXXXXX\\AppData\\Local\\Temp\\pip-install-fi3oz0fp\\ansible\\setup.py'"'"';
__file__='"'"'C:\\Users\\XXXXXXX\\AppData\\Local\\Temp\\pip-install-fi3oz0fp\\ansible\\setup.py'"'"';
f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');
f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\XXXXXXX\AppData\Local\Temp\pip-record-y3d0j5k5\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\XXXXXXX\python\test_env\include\site\python3.8\ansible' Check the logs for full command output.
From the documentation regarding requirements for the control node:
Currently Ansible can be run from any machine with Python 2 (version 2.7) or Python 3 (versions 3.5 and higher) installed. This includes Red Hat, Debian, CentOS, macOS, any of the BSDs, and so on. Windows is not supported for the control node.
Meanwhile you can run ansible on Windows 10 from WSL (prefered) or from cygwin.
I tried to install jnius, I installed Visual Studio Build Tools, but when I enter pip install jnius, I get error:
ERROR: Command errored out with exit status 1:
'c:\users\вввв\appdata\local\programs\python\python37-32\python.exe' -u -c 'import sys, setuptools,
tokenize; sys.argv[0] = '"'"'C:\\Users\\1D87~1\\AppData\\Local\\Temp\\pip-install-
9ggkbbff\\jnius\\setup.py'"'"'; __file__='"'"'C:\\Users\\1D87~1\\AppData\\Local\\Temp\\pip-install-
9ggkbbff\\jnius\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)
(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code,
__file__, '"'"'exec'"'"'))' install --record 'C:\Users\1D87~1\AppData\Local\Temp\pip-record-
hczhl1cy\install-record.txt' --single-version-externally-managed --compile Check the logs for full
command output.
ERROR: Failed building wheel for jnius
How can I fix it?
I hope you help me
jnius, which is this pypi project does not support python 3.7 officially.
A quick google search however yields that the module is now called pyjnius, see this GitHub page:
Warning: the pypi name is now pyjnius instead of jnius.
So use the correct version and do:
pip install pyjnius
There are whl files for windows and python 3.7, so the installation should go smoothly. If not, you can check the installation instructions in the docs
I am trying to setup evalai-cli using pip,
but i am facing problems during setup when i try to run
pip install evalai
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
ERROR: Command errored out with exit status 1:
command: 'c:\users\amana\evalai-cli\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\amana\AppData\Local\Temp\pip-install-iwb_ci9r\lxml\setup.py'"'"'; file='"'"'C:\Users\amana\AppData\Local\Temp\pip-install-iwb_ci9r\lxml\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\amana\AppData\Local\Temp\pip-record-tu5o2fvl\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\amana\evalai-cli\venv\include\site\python3.8\lxml'
cwd: C:\Users\amana\AppData\Local\Temp\pip-install-iwb_ci9r\lxml\
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
** make sure the development packages of libxml2 and libxslt are installed **
I have installed lxml using easy_install lxml & www.lfd.uci.edu
but still the problem remains
I am on windows 10 64 bit running python 38
Try to go to https://www.lfd.uci.edu/~gohlke/pythonlibs/
then you download the file lxml-4.4.2-cp38-cp38-win_amd64.whl
then open the Command and navigate to the folder containing the file lxml-4.4.2-cp38-cp38-win_amd64.whl
then run the Command pip install lxml-4.4.2-cp38-cp38-win_amd64.whl