I can't download scipy for python on raspberry pi [duplicate] - python

I am trying to install the scipy library with python3 -m pip install --user --no-use-pep517 scipy but I am receiving the following error:
ERROR: Failed building wheel for scipy
Running setup.py clean for scipy
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-spokr6ic/scipy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-spokr6ic/scipy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
cwd: /tmp/pip-install-spokr6ic/scipy
I am using that code to install because pip3 install scipy is giving me this error:
ERROR: Failed building wheel for scipy
Failed to build scipy
ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly
How can I resolve this issue?
Python == 3.7.3
PS:The complete traceback is 414 lines. I don't know if I should include here.

Try this:
sudo apt update
sudo apt install -y python3-scipy

Related

Can't install PyArrow on Ubuntu

I have an EC2 Ubuntu 18.04.3 LTS instance with python 3.6.9
I tried to install pyarrow with this command:
python3 -m pip install pyarrow
But I get an error:
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;
__file__='/tmp/pip-build-3q5nmx81/pyarrow/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-fgafmfzg-record/install-record.txt
--single-version-externally-managed --compile --user --prefix="
failed with error code 1 in /tmp/pip-build-3q5nmx81/pyarrow/
Reading the first messages after trying to install yarrow I see this:
Building wheels for collected packages: pyarrow
Running setup.py bdist_wheel for pyarrow ... error
Please, do you know how I can solve this issue? Thank you in advance.
If you are working in a virtual environment, it is likely that your pip version is the default one (9.0.1). Try to upgrade it with pip install --upgrade pip and run the command python3 -m pip install pyarrow again.
Tested under Ubuntu 18.04, with Python 3.6.9 and pyarrow==4.0.0

Error while installing Python-saml package in windows

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

How to use pip install while activating virtual environment in python

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

ERROR: Command errored out with exit status 1

I tried:
pip3 install -r requirements.txt
Here's the error I received:
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\Admin\AppData\Local\Temp\pip-install-6c3rea1s\pycocotools\
You are using pip version 19.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip'
command.
So, I tried:
pip install --upgrade pip
and
install pip3 install -r requirements.txt
That resulted in more errors:
ERROR: Command errored out with exit status 1: command:
'c:\users\admin\appdata\local\programs\python\python37-32\python.exe'
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-epmkeh4g\\pycocotools\\setup.py'"'"';
__file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-epmkeh4g\\pycocotools\\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
'C:\Users\Admin\AppData\Local\Temp\pip-install-epmkeh4g\pycocotools\pip-egg-info'
cwd:
C:\Users\Admin\AppData\Local\Temp\pip-install-epmkeh4g\pycocotools\
Complete output (5 lines): Traceback (most recent call last):
File "<string>", line 1, in <module> File
"C:\Users\Admin\AppData\Local\Temp\pip-install-epmkeh4g\pycocotools\setup.py",
line 2, in <module> from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'
---------------------------------------- ERROR: Command errored out
with exit status 1: python setup.py egg_info Check the logs for full
command output.
I deleted the folder and re-install, but the results remained the same.
This is a bug in pycocotools. The bug was fixed in 2017 but it seems the fix didn't get into release 2.0 in 2018 (I guess the release process is also buggy).
There is also another similar bug in setup.py — it imports numpy before installing it.
There is no simple workarounds for these bugs using requirements.txt. You need to install the required modules before installing pycocotools:
pip install Cython numpy
pip install -r requirements.txt

Installing package halo gives error: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers

Im trying to install Halo by using,
pip install halo
I get the following error message:
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/9s/vjh90rsn4xl5587hr11qpjjh0000gn/T/pip-install-L5LD_D/halo/setup.py'"'"'; __file__='"'"'/private/var/folders/9s/vjh90rsn4xl5587hr11qpjjh0000gn/T/pip-install-L5LD_D/halo/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 /private/var/folders/9s/vjh90rsn4xl5587hr11qpjjh0000gn/T/pip-install-L5LD_D/halo/pip-egg-info
cwd: /private/var/folders/9s/vjh90rsn4xl5587hr11qpjjh0000gn/T/pip-install-L5LD_D/halo/
Complete output (3 lines):
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
error in halo setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected ',' or end-of-list in backports.shutil_get_terminal_size>=1.0.0;python_version < '3.3' at ;python_version < '3.3'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
My python version is 2.7.10.
I made some research and tried the following solutions,
brew install halo
This did not work and my terminal returned:
Error: No formulae found in taps.
I checked my Formulae in Homebrew and could not find Halo. However, I found other packages so my Homebrew work otherwise.
I tried chaning my python version to 3 by changing alias and installing halo again, and it did not work either.
alias python='python3'
Error massage was the same as for python2, as above.
I need halo for a school lab, and im using Mac.
It looks like it's a known bug for that package:
https://github.com/manrajgrover/halo/issues/79
You just have to update setup tools via: pip install -U setuptools
If that doesn't work, try adding the --user flag: pip install --user -U setuptools
Try this command
pip3 install --user package-name # for Python3
pip install -U setuptools && pip install halo # for Python3
pip install --user package-name # for Python2
pip3 install -U setuptools && pip install halo # for Python2

Categories