How to update packages hashes? - python

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

Related

Pip package version conflicts despite seemingly matching ranges

When using pip install -r requirements.txt, I get ERROR: Cannot install -r requirements.txt (line 3), [...] because these package versions have conflicting dependencies..
And further:
The conflict is caused by:
tensorflow 2.11.0 depends on protobuf<3.20 and >=3.9.2
tensorboard 2.11.0 depends on protobuf<4 and >=3.9.2
wandb 0.13.5 depends on protobuf!=4.0.*, !=4.21.0, <5 and >=3.12.0
I don't see any conflicts in these ranges - every version in [3.12.0, 3.20) should be fine. Can someone explain the problem?
Update: As a workaround, I removed all version restrictions and only specified the names of the libraries in the requirements.txt file. Now it works. But I still don't see a problem with the above ranges, so I'll leave the question open.
I would suggest that, rather than using a range of versions, use a specific version you know works. That way, there won't be any problems.
I think that one of the versions of the dependencies is incompatible with the main module, and since it is within the range of versions you ask for, pip tries to intall it and fails to do so since it is incompatible.
Also, pip normally handles dependencies automatically.

Tensorflow installation occurs when using pip

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.

pip install package still not following dependency links

I'm having serious trouble with using setup.py to pip install my package which also has dependency links. I have read this answer and this one thoroughly and none of the answers including the accepted ones help.
Here is the setup.py for the package trying to install.
Basically, it reads the requirements.txt to fill install_requires and dependency_links, most of the rest of the code is boilerplate from cookie-cutter. requirements.txt has a private github repo in it which is causing the issues. e.g. git+https://${GITHUB_OAUTH_TOKEN}#github.com/jmerkow/pripy.git#egg=pripy
When I run pip install -r requirements.txt everything works great, it installs the private repository. However, if I try to install using pip install . --process-dependency-links, I get this error:
Could not find a version that satisfies the requirement pripy (from mypackage==<sha>) (from versions: )
No matching distribution found for pripy (from mypackage==<sha>)
If I take off the #egg=xxx from the link in requirements, the private repo package is completely ignored by pip install . but not by pip install -r requirements.txt.
I have confirmed that dependency_links contains 'git+https://<actual-token>#github.com/jmerkow/pripy.git#egg=pripy' and that install_requires includes 'pripy'
How do you get setup to properly Is this a problem with the sub-package? setup.py in that repo is done pretty much the same, except there are no private links.
Ugh, this always happens. I put in all the work to the question, then I figure it out myself.
The issue is two things, first, all dependeny_links need to have a version, second to pull the version from the requirements file properly you need to do some magic on the string.
Comparing to the above setup.py, I changes the way requirements are added to the two lists (updated here). Then add the version to #egg=xxx on the link e.g.
git+https://${GITHUB_OAUTH_TOKEN}#github.com/jmerkow/pripy.git#egg=pripy-0.
Now setup.py will parse that file, take the egg version info, convert it to a pip version (basically replace the first '-' with an '==') for the install_requires, and you're good to go.

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

SciPy can't install old version Windows 10

I'm trying to install an older version of SciPy (either 0.16.1 or 0.17.0), but when I try to use pip I get the result:
pip install scipy==0.16.1
I get the following message
Failed building wheel for scipy
So I found the .whl file here https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy but the problem is that the version here is 1.0.1, and I can't seem to find any older ones, even in the SciPy website (there are for linux and mac)
.
.
PS.
I need to use either of this versions because I'm trying to run Theano on a GPU, and the tutorial provided here http://deeplearning.net/software/theano/install_windows.html says this version is a requirement if there is any tutorial that is better and more up-to-date I would be appreciated

Categories