pythonanacondacondapprint

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.


Solution

  • 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.