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
Related
I'm using pip 20.2.3 on Linux to install additional packages (extras_require['test']) into a project that was first built using python setup.py build -b _build. In the project's directory, there's also a custom script called build (whose name I shouldn't change). When I run pip install .[test] it complains that build already exists and fails:
$ echo $TMPDIR
/.local/work/.ab/
$ pip install .[test]
[...]
ERROR: Command errored out with exit status 1:
command: /[...]/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/.local/work/.ab/pip-req-build-qxn943bk/setup.py'"'"'; __file__='"'"'/.local/work/.ab/pip-req-build-qxn943bk/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 /.local/work/.dv/pip-wheel-yhzxeqaj
cwd: /.local/work/.ab/pip-req-build-qxn943bk/
Complete output (5 lines):
running bdist_wheel
running build
running build_py
creating build
error: could not create 'build': File exists
----------------------------------------
ERROR: Failed building wheel for xxx
I've tried passing --build to pip but the option is marked as deprecated in man page and is obviously ignored.
Is there any other way I can make pip use another name for its build directory (e.g. _build), or is there a way to use python setup.py build -b _build to install only the extras_require['test'] packages?
I would like to use python-saml for sso integration with flask web app. while I am trying to install python-saml package using pip install python-saml, I am getting the below error message.
(myvenv) C:\Users\sekar>pip install python3-saml==1.9.0
Collecting python3-saml==1.9.0
Using cached python3_saml-1.9.0-py3-none-any.whl (72 kB)
Collecting xmlsec>=0.6.0
Using cached xmlsec-1.3.3.tar.gz (29 kB)
Building wheels for collected packages: xmlsec
Building wheel for xmlsec (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"'; __file__='"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\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 'C:\Users\sekar\AppData\Local\Temp\16\pip-wheel-39e4ydgb'
cwd: C:\Users\sekar\AppData\Local\Temp\16\pip-install-9x0le85b\xmlsec\
Complete output (5 lines):
running bdist_wheel
running build
running build_ext
error: HTTP Error 404: The specified blob does not exist.
Retrieving "https://ci.appveyor.com/api/buildjobs/hij3a6776pdv2007/artifacts/libxml2-2.9.4.win64.zip" to "build/extra\libxml2-2.9.4.win64.zip"
----------------------------------------
ERROR: Failed building wheel for xmlsec
Running setup.py clean for xmlsec
Failed to build xmlsec
Installing collected packages: xmlsec, python3-saml
Running setup.py install for xmlsec ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"'; __file__='"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\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\sekar\AppData\Local\Temp\16\pip-record-l_q25m6k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\Include\xmlsec'
cwd: C:\Users\sekar\AppData\Local\Temp\16\pip-install-9x0le85b\xmlsec\
Complete output (5 lines):
running install
running build
running build_ext
error: HTTP Error 404: The specified blob does not exist.
Retrieving "https://ci.appveyor.com/api/buildjobs/hij3a6776pdv2007/artifacts/libxml2-2.9.4.win64.zip" to "build/extra\libxml2-2.9.4.win64.zip"
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\setup.py'"'"'; __file__='"'"'C:\\Users\\sekar\\AppData\\Local\\Temp\\16\\pip-install-9x0le85b\\xmlsec\\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\sekar\AppData\Local\Temp\16\pip-record-l_q25m6k\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\sekar\AppData\Local\conda\conda\envs\myvenv\Include\xmlsec' Check the logs for full command output.
I tried with conda install python-saml, same error also they stopped this package 2 years before. even I tried python3-saml
the core issue is in xmlsec package..
is there any conda channels or PYPI provide this package?
Update
Since version 1.3.7, prebuilt wheels of xmlsec for Windows are published on PyPI, so you shouldn't experience this issue anymore.
Original answer
I have rebuilt xmlsec windows wheels and uploaded them to the releases page of my fork. To install, first install xmlsec passing the additional PyPI index:
$ pip install xmlsec --extra-index-url=https://hoefling.io/pypi
The added index just proxies install request to Github releases.
Now install python3-saml:
$ pip install python3-saml
(Alternative) Selecting the dist manually
You can manually find the wheel matching your Python installation from the releases page and install it using a direct link, e.g.
$ python -c "from pip._internal.pep425tags import get_supported; print(*get_supported()[0], sep='-')"
cp37-cp37m-win_amd64
# the matching wheel is thus xmlsec-1.3.6.post1-cp37-cp37m-win_amd64.whl
$ pip install https://github.com/hoefling/xmlsec/releases/download/1.3.6.post1/xmlsec-1.3.6.post1-cp37-cp37m-win_amd64.whl
(Optional) Verify xmlsec works by invoking the tests
I have executed tests against all built wheels (check out this job log on Appveyor), but you can also run the tests locally to verify xmlsec installation is working:
$ git clone https://github.com/mehcode/python-xmlsec.git && cd python-xmlsec
$ pip install pytest
$ pytest tests/
Never used python-saml here... However, while searching this error, I found these GitHub issues: Issue 1 and Issue 2
Both of them talk about a problem with dm.xmlsec.binding.
Best,
Felipe
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
I have venv activated using conda
$source activate /home/sim/anaconda3/envs/myenv
I am in venv (myenv) sim#ma-Vostro-15-3568:~/flask/venv$
python3 -m pip install psycopg2
i have tried pip3 also
python --version is 3.6
Error is below
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1:
command: /home/mak/anaconda3/envs/myenv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7ql73mks/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-7ql73mks/psycopg2/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 /tmp/pip-install-7ql73mks/psycopg2/pip-egg-info
cwd: /tmp/pip-install-7ql73mks/psycopg2/
Complete output (23 lines):
running egg_info
creating /tmp/pip-install-7ql73mks/psycopg2/pip-egg-info/psycopg2.egg-info
writing /tmp/pip-install-7ql73mks/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-install-7ql73mks/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-install-7ql73mks/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file '/tmp/pip-install-7ql73mks/psycopg2/pip-egg-info/psycopg2.egg-info/SOURCES.txt'
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).
According to error message, you can either 1. specify path, or 2. install psycopg2-binary using the command: pip3 install psycopg2-binary
Try this
sudo apt install libpq-dev python3-dev
Get help from LINK
The NLTK docs say it supports Python 3.7. However, when I try to install it with:
virtualenv -p python3.7 .env
. .env/bin/activate
pip install nltk
I get the error:
Collecting nltk
Using cached https://files.pythonhosted.org/packages/f6/1d/d925cfb4f324ede997f6d47bea4d9babba51b49e87a767c170b77005889d/nltk-3.4.5.zip
ERROR: Command errored out with exit status 1:
command: /path/to/my/project/.env/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-12ut35ws/nltk/setup.py'"'"'; __file__='"'"'/tmp/pip-install-12ut35ws/nltk/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-12ut35ws/nltk/
Complete output (1 lines):
error in nltk setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in singledispatch; python_version < "3.4" at ; python_version < "3.4"
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The error message sounds like NLTK only supports Python < 3.4, but that doesn't make any sense. What am I doing wrong?
It is because the package format was not supported by the distutils, which indicates the package tools may be too old.
Upgrade pip in the virtual environment.
pip install -U pip
pip install -U setuptools
Retry to install nltk.
. .env/bin/activate
pip install nltk
If this still doesn't work. Provide log from pip install nltk -v.
First of all you have to upgrade your pip by using this command
python -m pip install –upgrade pip
First of all you have to navigate to the location of the pip folder
C:\Users\Admin>cd C:\Python\Scripts
Then run this command
pip3 install nltk
hope it will work!