0

As you can see in the below code example, I want to install watchdog==1.0.1 and yet pip always tries to install the latest version (see watchdog version history).

PS C:\Users\username\Projects> pip install watchdog==1.0.1 --no-cache-dir
Collecting watchdog
  Downloading watchdog-2.1.3-py3-none-win_amd64.whl (75 kB)
     |████████████████████████████████| 75 kB 655 kB/s
ERROR: Could not find a version that satisfies the requirement 1.0.1 (from versions: none)
ERROR: No matching distribution found for 1.0.1

Previously, I had the issue that I would always use the cached version of watchdog. The resolution was pip cache purge which cleans up the entire pip cache. Moreover, adding --no-cache-dir after the install-command should do the trick as well. Nevertheless, pip install seems to consistently ignore the version provided by the user and tries to install the latest version.

Andreas L.
  • 3,239
  • 5
  • 26
  • 65

1 Answers1

0

A workaround would be:

Go to the release files of watchdog on pypi.org, download it and run

pip install .\watchdog-1.0.1-py3-none-win_amd64.whl

This manual install works. Before, you should uninstall watchdog, in case you haven't, via pip uninstall watchdog.

In case there is a better solution to the initial problem of pip ignoring the specified version, please let me know.


EDIT on possible cause of the problem:

This answer (credits to @Yoav Ben Haim in the first comment of my OP) suggests that

PyPI URL links do not work at times and throw a 404-response, and thus fallback URL links are re-directing infinitely due to sourceforge.net's recent upgrade and PyPI's stale URL

Andreas L.
  • 3,239
  • 5
  • 26
  • 65