Search code examples
pythongithubinstallationpip

Pip installing a whl-file from a private github repository


How can one install a .whl (python library) from a private github repo?

I have setup a personal access token and can install the library if its not a .whl by using the following command

pip install git+https://{token}@github.com/{org_name}/{repo_name}.git

However if there is a .whl in the repo and I want to install from that using:

pip install git+https://{token}@github.com/{org_name}/{repo_name}/blob/master/{name.whl}

Then I get the following error:

TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

I am stumped! You can pip install {name.whl} if the file is locally but not from the private github repo.

Quesiton: How to pip install name.whl on a private github repo?


Solution

  • You should be able to do

    pip install https://{token}@raw.githubusercontent.com/{user}/{repo}/master/{name.whl}