Problem:
When attempting to install a newly created Python package from testpypi.python.org, the pip installation fails with errors citing missing requirements, even though the package was successfully uploaded.
Answer:
To resolve this issue, specify both --index-url and --extra-index-url while installing the package from testpypi:
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple poirot
Explanation:
Note:
This solution addresses the immediate issue, but it can be unsafe in certain situations, especially on private servers. Refer to sources like [A. Sottile's video](https://www.youtube.com/watch?v=YdFKo9s92QA) for guidance on using --extra-index-url responsibly and understanding potential risks.
The above is the detailed content of Why Does My Python Package Install Successfully from PyPI but Fail from TestPyPI?. For more information, please follow other related articles on the PHP Chinese website!