14

I've packaged my private repo into a wheel. There are different versions of the wheel. Is it possible to install a specific wheel version of the repo using pip from the command line and via the requirements.txt file? This feature isn't mentioned in the pip documentation from what I can tell.

I can install a pip package from a private repository with no problem, using a Github token.

pip install git+https://$GITHUB_TOKEN@github.com/[username]/[reponame].git

I can also install a private pip package with a specific commit:

pip install git+https://$GITHUB_TOKEN@github.com/[username]/[reponame].git@[commit_sha]

skeller88
  • 4,276
  • 1
  • 32
  • 34

2 Answers2

1

According to current docs, installing wheels (with or without pinned version) from VCS is currently not supported by pip, and maybe it never will.

I suspect the reason is that a wheel is basically a "compiled artifact", so you wouldn't usually find those committed into a git repository, e.g. all the examples from the VCS page show examples that would install that dependency from source and build it locally.

Bastian Venthur
  • 12,515
  • 5
  • 44
  • 78
-3

If you want to install a specific wheel, you give pip the path or URL for that wheel:

pip install https://example.com/url/of/wheel.whl
jwodder
  • 54,758
  • 12
  • 108
  • 124
  • Can you please specify the url format if the wheel.whl locates in the "dist" folder of a repo branch? – Chenlu Feb 15 '19 at 14:57
  • @Chenlu: If you want to install from a local file, simply give the path to the file: `pip install /path/to/wheel.whl` – jwodder Feb 15 '19 at 15:39
  • @rjurney: This Q&A is for the case where you have a built wheel file that you want to install with pip. If you have a git repo but no wheel file, this does not apply to you. – jwodder Nov 21 '19 at 18:09
  • @jwodder I see, my mistake. – rjurney Nov 21 '19 at 22:07