Use .netrc with pip and gitlab pypi
Asked Answered
R

0

5

We have a gitlab pypi repository and a package that can be installed with the following command

pip install mypackage \
    --extra-index-url https://__token__:[email protected]/api/v4/projects/12345678/packages/pypi/simple

I try to follow the following answer link to setup the password in ~/.netrc.

My ~/.netrc file

machine gitlab.com
    login __token__
    password z-u5aFNdakdlsN

And try to install with

pip install mypackage \
    --extra-index-url https://gitlab.com/api/v4/projects/12345678/packages/pypi/simple

Still, pip continue to ask for login and password

Am I missing something ?

Reremouse answered 27/1, 2021 at 20:6 Comment(4)
I am assuming that isn't your password, so keep in mind that passwords in .netrc file should not contain spaces, since the .netrc file is parsed against spaces, tabs and new-lines.Abeu
Thx @dejdej. There is non space / tabs /new-line in the password. I made sure that the fake password in the question has the same format as the real one.Reremouse
Remove what's before '@' in your pip.conf index-url (including the @) --extra-index-url https://gitlab.com/api/v4/projects/12345678/packages/pypi/simpleGalitea
@Reremouse did you succeed to resolve this please? Thanks a lotLegged

© 2022 - 2024 — McMap. All rights reserved.