Tensorflow installation occurs when using pip - python

I'm trying to install TensorFlow using pip.Python version is 3.7.6 and pip version pip-20.0.2.when I run following line in command prompt
python -m pip install --user tensorflow
after downloading 20% I get the following message and download stopped.
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the
hashes. Otherwise, examine the package contents carefully; someone may
have tampered with them.
tensorflow from https://files.pythonhosted.org/packages/34/d5/ce8c17971067c0184c9045112b755be5461d5ce5253ef65a367e1298d7c5/tensorflow-2.1.0-cp37-cp37m-win_amd64.whl#sha256=7bad8ea686a1f33d9dac13eb578c4597346789d4f826980c8bbcfbd08e7dc921:
Expected sha256 7bad8ea686a1f33d9dac13eb578c4597346789d4f826980c8bbcfbd08e7dc921
Got dc1712222e4d481bf78da6cd0d9337752ed75654981cee3dd0f28523928c5beb
Please provide me some solutions.i am having lots of difficulties.

Related

Pandas installation fails with "OSError: [WinError8] Not enough storage is available to process this command"

I was trying to install pandas using this command:
python -m pip install pandas
Installation starts initially but then goes all red and returns this error:
Could not install packages due to an OSError: [WinError8] Not enough storage is available to process this command
--- Logging error ---
I don't think it's a memory issue because I checked usage and it was at a normal level.
I'm using Python 3.7 on Windows 7.
Any suggestions on how to fix it??
Eureka! I'm posting solution in case anyone encounters the same problem in the future.
After hours of trying a lot of different solutions I have finally succeed even though I still don't know what was the source of this problem.
To install pandas in case of facing error while downloading using pip command first download manually .whl files of pandas from PyPI website:
https://pypi.org/project/pandas/#files
Copy it to the folder that is used as your path in cmd console- don't change name of the file.
In cmd console use:
python -m pip install fullnameofthedownloadedfile.whl --no-deps
Use --no-deps as it's very likely that automatically downloaded dependencies will encounter similar errors during downloading as pandas- you will install them manually instead.
Once this is finished repeat process for numpy and dateutil and any other packages that might be required.
What a relief!!! Happy coding;)

PIP fails downloading any package due to checksums

I have a issue with PIP, I am not able to download any package, getting an error like:
ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
pyspark from https://files.pythonhosted.org/packages/8e/b0/bf9020b56492281b9c9d8aae8f44ff51e1bc91b3ef5a884385cb4e389a40/pyspark-3.0.0.tar.gz#sha256=8c6e5cc51d91eb8d43e81d0b7093292b5e144ac81445491d5f887d2cf4fe121f:
Expected sha256 8c6e5cc51d91eb8d43e81d0b7093292b5e144ac81445491d5f887d2cf4fe121f
Got 8193e8eb19deb43aec4a342f758fe36429546d095f4d4b1a841cd98185b2a7b0
I have already removed and reinstalled both Python and PiP without any success.
I have also tried using --no-cache-dir but the error still remains.
EDIT: I'm running Ubuntu Server 18.04 on VirtualBox in Windows 10

Error while installing pip using get-pip.py with Python2.7.10

I am using Python2.7.10 on a Windows10 machine, and wish to install pip.
I followed the instructions from here to get the get-pip.py file, but when I try to run it I get the following error:
Could not install packages due to an EnvironmentError: [Errno 42] Illegal byte sequence
I found that if I install an older version of pip (for Python2.6) then the installation is successful, and I can use pip regularly. If I try to use this older version (9.0.3) to install the newer one (18.0) then I get the same error message.
The complete log of the installation is below (1). If I manually install setuptools then I get the same message when it tries to download the next package:
Any assistance with installing the newer version will be much appreciated :-)
1)
C:\Python27\Lib\site-packages>python get-pip.py
Collecting pip
Using cached https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/ff/f4/385715ccc461885f3cedf57a41ae3c12b5fec3f35cce4c8706b1a112a133/setuptools-40.0.0-py2.py3-none-any.whl (567kB)
1% |Could not install packages due to an EnvironmentError: [Errno 42] Illegal byte sequence
Update: after installing several packages manually I was able to install the new pip version. It obviously didn't solve the problem, and pip is still not working. When trying to use it, the same error message appears at every attempted download. See log at (2). I double checked the address, and it appears to be correct.
2)
Collecting Requests
Downloading https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl (91kB)
11% |Could not install packages due to an EnvironmentError: [Errno 42] Illegal byte sequence
Thanks
tl;qr - add the quiet flag (-q) to your command
While trying to debug I redirected the output to a file:
python -m pip install requests > .\temp.txt
Surprisingly, everything suddenly worked!
It appears there is a known bug (Thanks Matan M) while displaying the progress bar to the console. Basically, any solution that would avoid writing it would work.
Here are some options:
Use the -q flag
Turn off the progress bar using --progress-bar off
Redirect to a temp file
:-)
Hi check if you added the relevant python paths to the PATH.
pip install <package> -q **or**
--progress-bar off

How to update packages hashes?

I'm sort of new to python, and using Anaconda3-5.1.0 on windows 10
i need to install package kwant, kwant is n't coming for anaconda windows , so i try pip install it ,after some struggle and reading here I found
kwant-1.3.2-cp36-cp36m-win_amd64.whl
so it match the platform , but this package need scipy and numpy and this comes with anaconda and when i try to pip install kwant ,i get this
THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
scipy>=0.14 from https://files.pythonhosted.org/packages/62/e2/364f0bcc641aeff79d743c732769d5dc31a1e78c27699229431412c4b425/scipy-1.1.0-cp36-none-win_amd64.whl#sha256=698c6409da58686f2df3d6f815491fd5b4c2de6817a45379517c92366eea208f (from kwant==1.3.2):
Expected sha256 698c6409da58686f2df3d6f815491fd5b4c2de6817a45379517c92366eea208f
Got 7072c63cb59028a73b639b354c0054525b002ef2d87a1d45ed7cdeba736b5cc6
numpy>=1.8.1 from https://files.pythonhosted.org/packages/af/e4/7d7107bdfb5c33f6cf33cdafea8c27d1209cf0068a6e3e3d3342be6f3578/numpy-1.14.3-cp36-none-win_amd64.whl#sha256=560e23a12e7599be8e8b67621396c5bc687fd54b48b890adbc71bc5a67333f86 (from kwant==1.3.2):
Expected sha256 560e23a12e7599be8e8b67621396c5bc687fd54b48b890adbc71bc5a67333f86
Got 143abb1baa1e5a3427ed09a4f52223aa3947bf76ca25dc4c71da0c2ae663040a
as i said I have updated scipy and numpy packages
so how could i update the HASHES so i can use kwant package
use this to install ,no-cache-dir
pip install --no-cache-dir kwant-1.3.2-cp36-cp36m-win_amd64.whl
it means to no use cache to do install , i also get it when i use window 10 .have fun,fix it

error when downloading the gensim package in python

I have been trying to install the gensim package in python using pip, using the pip.main(['install','gensim']). It works and starts downloading, but then I get the following error:
THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
gensim from https://files.pythonhosted.org/packages/82/f2/c2f2c87ed72483fce010fbfea1a3adbd168c0f0dafc878cbfb5a76381b03/gensim-3.4.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl#sha256=7bafe3f2fd49738942ef04396cb1e50a38283fe02203e5d4c66588daa01fb87c:
Expected sha256 7bafe3f2fd49738942ef04396cb1e50a38283fe02203e5d4c66588daa01fb87c
Got 728e9e79db209cfb0699c815c30a6169cefa61f46ef3471937100e4173fdbb3d
Any help would be appreciated
It seems like the package pip is trying to download and install is being modified in transit. You should be able to download, verify, and install the package yourself.
Download the package:
$ curl -O https://files.pythonhosted.org/packages/82/f2/c2f2c87ed72483fce010fbfea1a3adbd168c0f0dafc878cbfb5a76381b03/gensim-3.4.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Calculate the SHA256 sum to ensure the package has not been modifed:
$ openssl sha256 gensim-3.4.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
The output should be 7bafe3f2fd49738942ef04396cb1e50a38283fe02203e5d4c66588daa01fb87c (according to https://pypi.org/project/gensim/#files)
Install the package:
$ pip install gensim-3.4.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
I didn't solve the problem but I found a way to work around this challenge. I started using anaconda directly. I used the navigator to install gensim in my environments, then I used the spyder command prompt to run my codes.
These links are useful:
https://docs.anaconda.com/anaconda/navigator/
https://docs.anaconda.com/anaconda/install/
https://www.anaconda.com/download/#macos

Categories