3
votes

We have a local pypi in which we put some python packages. However, pip is unable to install the package.

pip search will find the package:

$ pip search --index=http://artifactory.ours.com/api/pypi/pypi-local/simple hello        
hello     - UNKNOWN

But pip install gives the following:

pip install --pre -r requirements.txt --trusted-host=artifactory.ours.com

Collecting hello (from -r requirements.txt (line 4)) Could not find a version that satisfies the requirement hello (from -r requirements.txt (line 4)) (from versions: ) No matching distribution found for hello (from -r requirements.txt (line 4))

and here is the requirements.txt:

# requirements.txt
--allow-all-external
--extra-index-url http://artifactory.ours.com/artifactory/api/pypi/pypi-local/simple

hello
3

3 Answers

1
votes

I believe the issue is that your package does not have a version number. Your setup.py does not specify the version.

Example from the Python documents (the example is for distutils):

https://docs.python.org/2/distutils/setupscript.html

1
votes

So the problem seems to be lifted if I use an older version of pip like 1.x. Not sure if this is jfrog bug or related to pip itself.

-1
votes

Another possible cause for this issue is when you use hyphen(-) in the name of the package while uploading it to artifactory. pip can successfully search and find your package but it cannot install it. Replace the hyphen with underscore.