简体   繁体   中英

pip install wheel version from private github repo

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]

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, eg all the examples from the VCS page show examples that would install that dependency from source and build it locally.

如果要安装特定的轮子,请为 pip 提供该轮子的路径或 URL:

pip install https://example.com/url/of/wheel.whl

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM