5

I am new to Nexus3, I am following the instruction here to upload a PyPI package (python v2.7): https://books.sonatype.com/nexus-book/3.0/reference/pypi.html
However, I got the following message prevent me from uploading the the package.

HTTPError: 401 Client Error: Unauthorized for url

I did the following steps and not sure if I missed anything:
1. Setup blob and repo name in Nexus3
2. Copy the url to .pypirc
3. python setup.py sdist; twine upload -r nexus3 dist/[secure]-0.1.0.tar.gz

Please suggest, Thanks!

Chengzhi
  • 2,531
  • 2
  • 27
  • 41
  • which nexus version are you using exactly? – Jakob Dec 31 '17 at 10:06
  • Are you using admin/admin123? If so is admin enabled? If not, I'd recheck your username/password in your pypirc. 401 indicates it's wrong. I'd ask to see it but if you're not using admin/admin123, it's probably sensitive and I wouldn't be able to tell anyway. Here's mine if it helps: cat .pypirc [distutils] index-servers = nexus [nexus] repository: http://localhost:8081/repository/pypi-hosted/ username: admin password: admin123 – joedragons Jan 03 '18 at 00:10
  • @Chengzhi have you tried without .pypirc config ? you can tell twine to which server, worked for me. try - twine upload --repository-url http://repository// dist/* – Yoni Jun 17 '18 at 07:20

1 Answers1

3

I had to add --config-file .pypirc to twine upload.

So

twine upload --config-file .pypirc -r nexus3 dist/[secure]-0.1.0.tar.gz
Clintm
  • 4,505
  • 3
  • 41
  • 54