Forums

pip install can't find and install dependencies

Not actually sure if this is something I'm doing wrong or some nuance in how pythonanywhere is configured, but here is my problem:

I created a package on test.pypi.org (it's not ready yet for real deployment on pypi.org) and wanted to test it in my flask app here on pythonanywhere. In the bash shell, I ran:

pip install --user  -i https://test.pypi.org/simple/ python-fix-explainer==0.0.1

It finds the package, but when trying to install dependencies, it throws errors like:

ERROR: Could not find a version that satisfies the requirement asttokens>=2.1.0 (from python-fix-explainer) (from versions: none)
ERROR: No matching distribution found for asttokens>=2.1.0

If I separately do pip install --user asttokens, then it moves on and complains about the next dependency.

When I manually installed each dependency with pip install, my actual package installed successfully too.

Any idea why pip might have trouble finding the dependencies?

How did you set up your project and how dependencies are defined? Also, it's rather a general question regarding packaging in Python -- you can look at broader forums, since those are typically PythonAnywhere focused.

Again, I wasn't sure if it had to do with some setup on how the PythonAnywhere configuration decided where and how to look for packages.

That said, I actually found the answer almost as soon as I submitted the forum post, I just couldn't do anything about it for hours, because apparently I have no access to my post until it gets approved on this system?..

it does seem to be a generic problem that's existed for 6+ years and the testpypi pages for your package just give you the wrong command: https://stackoverflow.com/questions/34514703/pip-install-from-pypi-works-but-from-testpypi-fails-cannot-find-requirements

What do you mean by "your package"?