I am trying to install a python package my_package
from a private Github repo using pip
. I am using Github oauth tokens (aka personal access tokens) for security. My token is stored in the environment variable $API_TOKEN
.
From the console if I do:
pip install git+https://${API_TOKEN}@github.com/johnf1004/my_package.git
then it works perfectly.
According to the documentation, you should be able to use environment variables inside requirements.txt
. However if I do pip install -r requirements.txt
where the file has the exact same address as above (git+https://${API_TOKEN}@github.com/johnf1004/my_package.git
) then it fails with a password prompt. FWIW, even a correct password for my Github account still results in failure.
Am I formatting the address/env variable wrong in the requirements file, or what am I missing?