Can't pip install from nexus pypi repository

5,864 views
Skip to first unread message

of...@playstudios-il.com

unread,
Aug 7, 2018, 6:34:51 AM8/7/18
to Nexus Users
Hi,
I've setup a hosted pypi repository on nexus and uploaded a package to the repository.
When I try to "pip install" from that repository, I always get the same error:

unsupported archive format: .1
Could not find a version that satisfies the requirement <my package name> (from versions: )

This is not a permissions issue, and it looks as if the ".1"  in the error is taken from the package version (0.0.1).
When looking in the pypi repository on nexus, I see that the package is stored in the following directory structure:
<package nama>
               |
               | ------> 0.0.1
                               |
                               | ------> <package name>-0.0.1.tar.gz


I can browse as anonymous to the package url on nexus, and I'm also able to install it directly with pip if I put the full url of the package on nexus (e.g.: pip install https://<my nexus url>/<package path on nexus>.tar.gz

I was unable so far to find any solution for this.

Can someone help?

Thanks.

Peter Lynch

unread,
Aug 7, 2018, 8:25:54 AM8/7/18
to of...@playstudios-il.com, Nexus Users
On Tue, Aug 7, 2018 at 7:34 AM <of...@playstudios-il.com> wrote:
Hi,
I've setup a hosted pypi repository on nexus and uploaded a package to the repository.

Can you list the exact steps you did to upload to a hosted Pypi repository? Be as specific as possible.
 
When I try to "pip install" from that repository, I always get the same error:

unsupported archive format: .1
Could not find a version that satisfies the requirement <my package name> (from versions: )

What have you got for the index and index-url values in your pip config?
 

This is not a permissions issue, and it looks as if the ".1"  in the error is taken from the package version (0.0.1).
When looking in the pypi repository on nexus, I see that the package is stored in the following directory structure:
<package nama>
               |
               | ------> 0.0.1
                               |
                               | ------> <package name>-0.0.1.tar.gz


I can browse as anonymous to the package url on nexus, and I'm also able to install it directly with pip if I put the full url of the package on nexus (e.g.: pip install https://<my nexus url>/<package path on nexus>.tar.gz

I was unable so far to find any solution for this.

Can someone help?

Thanks.

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Please note that any disclosure, copying or distribution of the content of this information is strictly forbidden. If you have received this email message in error, please destroy it immediately and notify its sender.

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/e160947f-8b3e-4009-bb8a-32c730169951%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

of...@playstudios-il.com

unread,
Aug 7, 2018, 12:39:52 PM8/7/18
to Nexus Users, of...@playstudios-il.com
Hi Peter,
Thanks for your help!

I used setuptools in the setup.py file to upload the package. I created a ".pypirc" file with the following format:
[server-login]
repository: <repository url as indicated in the nexus pypi repository>
username: <user name>
password: <password>

Then, I ran:
setup.py sdist bdist_wheel upload

I also uploaded the file manually to the nexus pypi repo, using the "upload" button, and the result was the same (same directory structure, with the version folder)

I wasn't sure at the begging which url exactly I should put in the extra-index-url field, eventually I clicked the "html view" for the repository, and I put that url:
https://<nexus server dns name>/service/rest/repository/browse/<my pypi repository>/

When browsing to this url I can see the "index of" my package, and below it the versions directory (and underneath it all the files).
Thanks

Rich Seddon

unread,
Aug 7, 2018, 12:44:01 PM8/7/18
to Nexus Users, of...@playstudios-il.com
You need to follow the instructions here for the pip.conf file in order for "pip install" to work:


Note that is separate from the .pypirc file.  Has this configuration been done?

of...@playstudios-il.com

unread,
Aug 7, 2018, 1:21:06 PM8/7/18
to Nexus Users, of...@playstudios-il.com
I followed the instructions. However, I'm not sure which url exactly should I put in the "index-url" field.
I tried both the "html view" of the repository and the url stated in the repository configuration. both are not working.

Rich Seddon

unread,
Aug 7, 2018, 1:32:29 PM8/7/18
to of...@playstudios-il.com, Nexus Users
Append "/pypi" and "/simple" to the repository URL:

index = http://localhost:8081/repository/pypi-all/pypi
index-url = http://localhost:8081/repository/pypi-all/simple

of...@playstudios-il.com

unread,
Aug 7, 2018, 1:59:53 PM8/7/18
to Nexus Users, of...@playstudios-il.com
Also tried that. Doesn't work...

Lucia Cardenas

unread,
Dec 30, 2019, 4:36:48 PM12/30/19
to Nexus Users, of...@playstudios-il.com
Hi there, i was having the same problem ,   I added first the proxy urls as the main ones and then i added the extra-index-url =  xxxx.com for the rest of the configurations, that worked for me :) 

[global]
Reply all
Reply to author
Forward
0 new messages