environment-variablespipenvpipfile

Pipenv Pipfile - installing package from private repo


I'm trying to install a package via Pipfile from a private repo.

Using the following syntax, VScode is asking for a password (in console it is locking forever), although my token is exported to my env variables:

[packages]
pack1 = {editable = true, git = "https://${ACCESS_TOKEN}@github.com/.../pack1.git"}

Using the ACCESS_TOKEN directly it works like expected:

[packages]
pack1 = {editable = true, git = "https://myToken@github.com/.../pack1.git"}

Using pipenv install command works also fine with my environment variable (ACCESS_TOKEN):

pipenv install -e git+https://${ACCESS_TOKEN}@github.com/.../pack1.git

Do you have any ideas how to solve it?

Thanks!


Solution

  • This is likely due to your pipenv version not supporting env-var expansion in the requirements (packages) section (see this issue). This was fixed in pipenv version 2020.11.15.

    I had this exact problem with an older version and indeed upgrading pipenv to 2020.11.15 made it work.