What it means
requirements.txt asks for a package at a version, and pip found nothing that fits. The build says the same in one sentence: no version of the package matches what requirements.txt asks for. This often means the package does not publish a build for the Python version in use.
How to fix it
-
Try a different Python version
Some packages, such as
tensorflow,torch,numpyandpandas, publish builds some months after a new Python release. Pin an older Python in a.python-versionfile, for example3.12, and deploy again. -
Loosen the version
Replace an exact pin such as
torch==2.0.0with a range, or remove the pin, so pip can choose a version that has a build. -
Check the name
A typo in the package name gives the same error. Check the spelling against the package's page on PyPI.
3.12
Why it happens
-
An old pin. A version from an old tutorial that has since been removed, or never had a build for your Python.
-
A new Python. A package that has not published builds for it yet.
-
A package that only exists locally. A private or renamed package that pip cannot find.