0

Hello I am trying to install a python package with pipenv, the package is in a private repository and I am using access token in order to download it.

The problem is that when I execute pipenv I got the following error:

Could not resolve host: @github.com

The GitHub URL is https://token@github.com/user/repo, and when I put it into the browser I can get access to it.

The GitHub token has the following permissions:

enter image description here

Any idea about why cannot download install with pipenv?

Thanks

UPDATE I used the following examples:

pipenv install -e "git://token@github.com/user/repo#egg=package"

WARNING: not enough values to unpack (expected 2, got 1)

pipenv install -e "git+http://token@github.com/user/repo#egg=package"

pipenv install -e "git+https://token@github.com/user/repo#egg=package"

Could not resolve host: @github.com

Tlaloc-ES
  • 4,825
  • 7
  • 38
  • 84
  • Can you give an example of the actual `pipenv` command you used? Also, does it work if you remove the `https://` part? – MattDMo May 29 '21 at 19:57
  • updated, with the examples and responses – Tlaloc-ES May 29 '21 at 20:02
  • Have you looked at https://stackoverflow.com/questions/4830856/is-it-possible-to-use-pip-to-install-a-package-from-a-private-github-repository?rq=1? and https://stackoverflow.com/questions/18935539/authenticate-with-github-using-a-token? – MattDMo May 29 '21 at 20:10
  • I did, but the problem is that pipenv doesn't recognize the token, I could clone separately the repo with the same url+token, but pipenv return that error and I try to get access to a file into release I got 404 error, but I copy and paste the URL in the browser I can download the whl file. – Tlaloc-ES May 29 '21 at 20:15
  • I found a couple of issues in the pipenv repo ([#313](https://github.com/pypa/pipenv/issues/313) and [#1393](https://github.com/pypa/pipenv/issues/1393)) that may be of assistance, in addition to using `curl` to authenticate as in one of the questions I linked above. I think you need to authenticate with username:token using `curl` first, then use the git clone link format discussed in the two issues. That *should* do it. – MattDMo May 29 '21 at 20:28
  • I'd also recommend trying `pipenv install -e "git://user:token@github.com/user/repo#egg=package"` – MattDMo May 29 '21 at 20:29
  • If I use this: echo "machine github.com login ei-grad password mypasswordshouldbehere" > ~/.netrc pip install "git+https://github.com/ei-grad/my_private_repo.git#egg=my_private_repo" terminal launch a promt in order to open github and do login, and I need put this in a docker contsainer so I think that this cannot be a solucion. – Tlaloc-ES May 29 '21 at 20:36

1 Answers1

0

Finally, it only worked putting the package in the pipenv file and installing.

Tlaloc-ES
  • 4,825
  • 7
  • 38
  • 84