Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: Could not find a version that satisfies the requirement pprint (from -r requirements.txt (line 67)) (from versions: none)

I am trying to install a NLP suite on my macbook pro, which is updated to the most recent software version Catalina 10.15.6. So far, I have installed Anaconda 3.8, created a version 3.7 NLP environment by conda create -n NLP python=3.7, and activated the NLP environment by conda activate NLP.

My next step is to install all python packages that are written in the file "requirements.txt" with the following command pip install -r requirements.txt. However, it showcases this message: "ERROR: Could not find a version that satisfies the requirement pprint (from -r requirements.txt (line 67)) (from versions: none) ERROR: No matching distribution found for pprint (from -r requirements.txt (line 67))"

I also tried installing the package alone, however, the same error message appears.

Any advice would be appreciated! Please let me know if any additional information I can provide.

like image 959
confusedallthetime Avatar asked Aug 17 '20 19:08

confusedallthetime


People also ask

Why can't I find a version that satisfies the requirement?

It looks like this: Could not find a version that satisfies the requirement (from versions:) No matching distribution found for Some probable reasons for this error are: PyPI server isn't responding to your requests.

Why can't I install pprint without dependencies?

pprint is part of the standard library, therefore cannot be present in requirements.txt. If one of your requirements is stated to require pprint you'll get an error. To install without dependencies use the --no-deps command for pip.

Why am I getting an error when trying to install a package?

Sometimes you get an error when you're trying to install a Python package using pip. It looks like this: Could not find a version that satisfies the requirement (from versions:) No matching distribution found for Some probable reasons for this error are: PyPI server isn't responding to your requests.

What version of Pip is used for collecting requirements TXT?

Collecting requirements.txt Could not find a version that satisfies the requirement requirements.txt (from versions: ) No matching distribution found for requirements.txt You are using pip version 9.0.1, however version 9.0.3 is available. You should consider upgrading via the 'pip install --upgrade pip' command.


1 Answers

pprint is part of the standard library, therefore cannot be present in requirements.txt. If one of your requirements is stated to require pprint you'll get an error. To install without dependencies use the --no-deps command for pip. However, this does not guarantee that the installation actually worked as you are likely missing out on other packages. So a better option is installing each requirement one by one until you find the one that needs it and install its other dependencies and install that package with no-deps.

An alternative is to use https://pypi.org/project/pipdeptree/ to inspect the dependency tree.

If there are many packages and there is a version freeze, try dropping the versions.

It is a bit of trial and error detective work, so one can be smart about it: it is likely a less used dependency that is the culprit.

like image 169
Matteo Ferla Avatar answered Oct 08 '22 19:10

Matteo Ferla