pip uses incorrect cached package version, instead of the user-specified version
If using pip 6.0 or newer, try adding the --no-cache-dir
option (source).
If using pip older than pip 6.0, upgrade it with pip install -U pip
.
PyPi lead to older version of my package instead of the latest
Can you check with:
pip install easy-predictor==
So without a version?
I get this:
ERROR: Could not find a version that satisfies the requirement easy-predictor== (from versions: 0.0.1, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.6.4, 0.6.5)
So 0.6.5 is available in the list.
Pip does ONLY install old and wrong version of my own package
It seems to me that the current version (0.1.1) requires PIL, which cannot be installed using pip
:
pip install sgraphic==0.1.1
Collecting sgraphic==0.1.1
Using cached sgraphic-0.1.1.tar.gz (4.4 kB)
Collecting skia-python
Using cached skia_python-87.2-cp39-cp39-win_amd64.whl (4.3 MB)
Collecting IPython
Using cached ipython-7.27.0-py3-none-any.whl (787 kB)
ERROR: Could not find a version that satisfies the requirement PIL (from sgraphic) (from versions: none)
ERROR: No matching distribution found for PIL
Because pip
cannot install all dependencies, it fails to install sgraphic 0.1.1. However, if you do not explicitly request this version, pip
will try to find an older version that it can install. Apparently, version 0.0.3 is the latest version it can install, so in your case it did that.
I think this is simply a bug in the latest versions of the sgraphic package. The code contains import PIL
, but the package that contains PIL is actually called Pillow. It's also possible that (the original) PIL is supposed to be installed in another way, but I could not find any information about that.
NB: I created an issue on github to ask the author of the package. It was indeed a bug and is now fixed in version 0.1.2, which I could install successfully using pip
.
Pip Package dependency overriding specified version in requirements.txt
Use pipenv: https://pipenv.pypa.io/.
At least some time ago, Pip used to have some flaws in solving multiple packages dependencies. I now saw an update note on their documentation that seems to tackle the problem; haven't tested yet. Pipenv would solve the dependencies graph just fine. That was one of the reason I started using Pipenv.
Please, have a look at the following pages:
- https://realpython.com/pipenv-guide/ (pipenv; your scenario)
- https://pip.pypa.io/en/stable/topics/dependency-resolution/#backtracking (pip; recent update)
- https://stackoverflow.com/a/55826767/687896 (similar question)
Pip is unable to find version for package in Linux server
The last version in the error message, click 8.0.4 requires Python >= 3.6. Version 8.1.3 requires Python >= 3.7. From this I can deduce you're using Python 3.6. Either use click 8.0.4, the last version that supports Python 3.6. Or upgrade to later Python version, at least 3.7.
Related Topics
How to Write a Python Dictionary to a CSV File
Converting Int to Bytes in Python 3
How to Install Python Packages on Windows
How to Use Subprocess Popen Python
Way to Change Google Chrome User Agent in Selenium
Add Leading Zeros to Strings in Pandas Dataframe
Lost Connection to MySQL Server During Query
Transpose Column to Row with Spark
How to Validate Ip Address in Python
How to Run an External Command Asynchronously from Python
How to Use the Same Python Virtualenv on Both Windows and Linux
What Is Different Between Makedirs and Mkdir of Os
How to Execute Python File in Linux