1

For the numpy, pip install numpy==? is not working. It just shows an error message without available package versions.

This happens after I got pip upgraded to 20.3.

MEOWWWWWWWW
  • 175
  • 2
  • 9

4 Answers4

4

add to your ~/.bashrc

function pipver() { curl -s https://pypi.org/rss/project/$1/releases.xml | sed -n 's/\s*<title>\([0-9.]*\).*/\1/p' ;}

Then open a new terminal window and invoke, using: pipver numpy
substituting whichever module you're looking for version info on.

1.19.4
1.19.3
1.19.2
1.19.1
etc...


It gathers the relevant .rss XML with curl, then pipes that through sed the stream-editor, selecting lines that match <title>[version.numbers] then only printing out those captured version numbers for you.

Doyousketch2
  • 2,060
  • 1
  • 11
  • 11
  • Great, however your sed filter cannot handle version codes like "1.0.1b". I suggest this instead: `function pipver() { curl -s https://pypi.org/rss/project/$1/releases.xml | sed -n 's/\s*\([^<]*\).*/\1/p' ;}`. – tif Dec 13 '20 at 12:38
  • 1
    Or with a one-liner output: `function pipvers() { curl -s https://pypi.org/rss/project/$1/releases.xml | sed -n 's/\s*\([^<]*\).*/ \1/p' | paste -sd, ;}` . – tif Dec 13 '20 at 13:03
1
ERROR: Could not find a version that satisfies the requirement numpy==?
ERROR: No matching distribution found for numpy==?

I think this is your error and it comes even with earlier versions, with earlier versions of pip and the command "pip install numpy==", it used to return an error and a list of all versions. I am not sure about the command for this in the latest version of pip, but you can visit https://pypi.org/project/numpy/#history to get to know about all the releases

Although there is a way to get to know the installed version of a package using pip show numpy -V

After doing some research, I got this python code that when run, returns the package versions available

Code:

import luddite
print(luddite.get_versions_pypi("numpy")) #Change the string here for your package

You need to first install this package using this command,

pip install luddite
Coder9390
  • 163
  • 1
  • 1
  • 9
  • Partially works for me: `pip2.7 --version` -> *pip 20.3*; `pip2.7 install numpy==` -> *ERROR: Could not find a version that satisfies the requirement numpy== (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0, 1.10.0.post2,…* – phd Dec 02 '20 at 06:30
  • `pip3.7 --version` -> *pip 20.3*; `pip3.7 install numpy==` -> *ERROR: Could not find a version that satisfies the requirement numpy==* – phd Dec 02 '20 at 06:31
1

To see available PyPI package versions with pip 20.3, pass --use-deprecated legacy-resolver.

This issue is recorded at https://github.com/pypa/pip/issues/9139. The current workaround in action:

$ pip wheel --no-deps wheel== --use-deprecated legacy-resolver
ERROR: Could not find a version that satisfies the requirement wheel== (from versions: 0.1, 0.2, 0.3, 0.4, 0.4.1, 0.4.2, 0.5, 0.6, 0.7, 0.8, 0.9, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.9.5, 0.9.6, 0.9.7, 0.10.0, 0.10.1, 0.10.2, 0.10.3, 0.11.0, 0.12.0, 0.13.0, 0.14.0, 0.15.0, 0.16.0, 0.17.0, 0.18.0, 0.19.0, 0.21.0, 0.22.0, 0.23.0, 0.24.0, 0.25.0, 0.26.0, 0.27.0, 0.28.0, 0.29.0, 0.30.0a0, 0.30.0, 0.31.0, 0.31.1, 0.32.0, 0.32.1, 0.32.2, 0.32.3, 0.33.0, 0.33.1, 0.33.4, 0.33.5, 0.33.6, 0.34.0, 0.34.1, 0.34.2, 0.35.0, 0.35.1, 0.36.0, 0.36.1)
ERROR: No matching distribution found for wheel==
WARNING: You are using pip version 20.3; however, version 20.3.1 is available.

This workaround will be deprecated in pip 21.

ddelange
  • 1,037
  • 10
  • 24
-1

This does not answer the question as you (and I) want it to be answered, but I just looked through the documentation on 20.3 as well as the change log and found zilch. I'm not going to waste any more time on this, so my work around is reverting.

pip install pip==20.2.4

It is not ideal. I can suffer through the warnings that I should upgrade pip until they make that list or a suitable alternative available again.

If you really need the functionality, this will at least let you solve the underlying question about package X (in this case, numpy) until someone in the know comes by.

Dan
  • 1