Install package with pip from specific branch of github

≡放荡痞女 提交于 2019-12-06 18:29:37

问题


I have across a very weird issue. I try to pip install a package from my github fork. I have done this multiple times in the past and it works always.

This is what I do:

pip install git+https...@my_branch

While this works perfectly in my local machine, when I try to w Windows Remote machine and to my Ubuntu Vagrant box it doesnt work.

Instead of installing the package with my_branch, it installs the master branch. Initially I thought it was related with an outdated version of pip but after upgrading to the latest version, I keep facing the same issue.

Any ideas whats the problem?


回答1:


Maybe some characters like the @ character are not recognized properly in your command in other environments? Try putting quotes, like this: pip install "git+https...@my_branch"




回答2:


Suppose you have forked some git repo and made some changes. To install this specific branch:

  1. Release a new version from your branch and add a version tag, like v1.0
  2. Run pip install -e git+https://github.com/your_user_name/repo_name@v1.0#egg=repo_name in the terminal


来源:https://stackoverflow.com/questions/41491790/install-package-with-pip-from-specific-branch-of-github

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!