Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab: able to clone but not pip install directly

I have access to a specific (internal) gitlab repo which I can clone, (having configured my ssh key on the server):

git clone git@mygitlabserver:mynamespace/myproject.git

However, when trying to directly install via pip a specific artifact from a tag:

pip install git+ssh://mygitlabserver:mynamespace/[email protected]#egg=myartifact

I get a password prompt.

I have also tried the following:

pip install git+ssh://atemporaryTOKENofmine@mygitlabserver:mynamespace/[email protected]#egg=myartifact

pip install git+ssh://oauth2:atemporaryTOKENofmine@mygitlabserver:mynamespace/[email protected]#egg=myartifact

pip install git+ssh://gitlab-ci-token:atemporaryTOKENofmine@mygitlabserver:mynamespace/[email protected]#egg=myartifact

Any suggestions?

edit: the proposed duplicate does not resolve my issue cause it is not the case of a passphrase-protected key, but rather than a wrong url used.

Thanks to @nils-werner for resolving it (check accepted answer)

like image 508
pkaramol Avatar asked Oct 29 '25 20:10

pkaramol


1 Answers

You're mixing two kinds of URLs:

git@mygitlabserver:mynamespace/myproject.git

Is equivalent to

ssh://git@mygitlabserver/mynamespace/myproject.git

whereas you tried (note the missing username and incorrectly used colon)

ssh://mygitlabserver:mynamespace/myproject.git

This means the correct pip command is

pip install git+ssh://git@mygitlabserver/mynamespace/[email protected]#egg=myartifact
like image 191
Nils Werner Avatar answered Oct 31 '25 10:10

Nils Werner