尝试pip
安装repo的特定分支.谷歌告诉我
pip install git + https://github.com/user/repo.git@branch
这个分支的名字是issue/34/oscar-0.6
我做的,pip install https://github.com/tangentlabs/django-oscar-paypal.git@/issue/34/oscar-0.6
但它返回404.
我该如何安装这个分支?
fal*_*tru 849
前缀url前缀git+
(请参阅VCS支持):
pip install git+https://github.com/tangentlabs/django-oscar-paypal.git@issue/34/oscar-0.6
Run Code Online (Sandbox Code Playgroud)
并指定不带前导的分支名称/
.
Ste*_*e K 286
使用带git +的pip来克隆存储库可能非常慢(例如,使用https://github.com/django/django@stable/1.6.x进行测试,需要几分钟).我发现的最快的东西是GitHub和BitBucket,它是:
pip install https://github.com/user/repository/archive/branch.zip
Run Code Online (Sandbox Code Playgroud)
成为django大师:
pip install https://github.com/django/django/archive/master.zip
Run Code Online (Sandbox Code Playgroud)
对于django stable/1.7.x:
pip install https://github.com/django/django/archive/stable/1.7.x.zip
Run Code Online (Sandbox Code Playgroud)
使用BitBucket,它具有相同的可预测模式:
pip install https://bitbucket.org/izi/django-admin-tools/get/default.zip
Run Code Online (Sandbox Code Playgroud)
这里,主分支通常被命名为default.这将使您的requirements.txt安装更快.
其他一些答案提到了将要安装的包装放入您的包装时所需的变化requirements.txt
.请注意,这个档案的语法,领先-e
和落后#egg=blah-blah
的不是必需的,你可以只是简单粘贴URL,所以你requirements.txt是这样的:
https://github.com/user/repository/archive/branch.zip
Run Code Online (Sandbox Code Playgroud)
Jaa*_*kko 55
使用ssh凭据从私有存储库安装的说明.
用法:
$ pip install git+ssh://git@github.com/myuser/foo.git@my_version
Run Code Online (Sandbox Code Playgroud)
用于开发:
$ git clone git@github.com/myuser/foo.git@my_version
$ pip install --editable ./
Run Code Online (Sandbox Code Playgroud)
Has*_*sek 48
只是添加一个额外的,如果你想在你的pip文件中安装它,可以像这样添加:
-e git+https://github.com/tangentlabs/django-oscar-paypal.git@issue/34/oscar-0.6#egg=django-oscar-paypal
Run Code Online (Sandbox Code Playgroud)
它虽然会被保存为鸡蛋.
Dee*_*rma 14
这就像魅力一样:
pip3 install git+https://github.com/deepak1725/fabric8-analytics-worker.git@develop
Run Code Online (Sandbox Code Playgroud)
在哪里 :
开发:分支
fabric8-analytics-worker.git :回购
deepak1725:用户
Cha*_*ker 11
给我你对问题工作的建议,例如
\npip install https://github.com/user/repo.git@branch\n
Run Code Online (Sandbox Code Playgroud)\n具体转化为做
\npip install -U git+https://github.com/moskomule/anatome.git@dev\n
Run Code Online (Sandbox Code Playgroud)\n工作了。也许删除多余的部分/
是多余的。我的输出:
(original_anatome_env) brando~/ultimate-anatome \xe2\x9d\xaf pip install -U git+https://github.com/moskomule/anatome.git@dev\nCollecting git+https://github.com/moskomule/anatome.git@dev\n Cloning https://github.com/moskomule/anatome.git (to revision dev) to /private/var/folders/x4/0xq0brj57xz3dbhbmblypbm00000gr/T/pip-req-build-62d_ghd2\n Running command git clone -q https://github.com/moskomule/anatome.git /private/var/folders/x4/0xq0brj57xz3dbhbmblypbm00000gr/T/pip-req-build-62d_ghd2\n Running command git checkout -b dev --track origin/dev\n Switched to a new branch 'dev'\n Branch 'dev' set up to track remote branch 'dev' from 'origin'.\n Resolved https://github.com/moskomule/anatome.git to commit 4b576e51cb1824a57ea04974e0f92b5a6143294d\nRequirement already satisfied: torch>=1.10.0 in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from anatome==0.0.6) (1.10.0)\nRequirement already satisfied: torchvision>=0.11.1 in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from anatome==0.0.6) (0.11.1)\nRequirement already satisfied: typing-extensions in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from torch>=1.10.0->anatome==0.0.6) (3.10.0.2)\nRequirement already satisfied: pillow!=8.3.0,>=5.3.0 in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from torchvision>=0.11.1->anatome==0.0.6) (8.4.0)\nRequirement already satisfied: numpy in /Users/brando/anaconda3/envs/metalearning/envs/original_anatome_env/lib/python3.9/site-packages (from torchvision>=0.11.1->anatome==0.0.6) (1.21.4)\nBuilding wheels for collected packages: anatome\n Building wheel for anatome (setup.py) ... done\n Created wheel for anatome: filename=anatome-0.0.6-py3-none-any.whl size=10167 sha256=63b12a36f33deb8313bfe7756be60bd08915b8ba36711be47e292b590df70f61\n Stored in directory: /private/var/folders/x4/0xq0brj57xz3dbhbmblypbm00000gr/T/pip-ephem-wheel-cache-rde_ngug/wheels/19/e4/be/01479e8cba62ae8cdcd501cd3bf49e199f2bb94732a6a1b006\nSuccessfully built anatome\nInstalling collected packages: anatome\n Attempting uninstall: anatome\n Found existing installation: anatome 0.0.5\n Uninstalling anatome-0.0.5:\n Successfully uninstalled anatome-0.0.5\nSuccessfully installed anatome-0.0.6\n
Run Code Online (Sandbox Code Playgroud)\n0.6.0 是 dev 分支版本号,0.5.0 是 master 分支,所以它有效!
\n您使用了egg 文件安装程序。该程序支持安装了git
,git+http
,git+https
,git+ssh
,git+git
和git+file
。其中一些被提及。
您可以使用分支、标签或散列进行安装,这很好。
@Steve_K 指出使用“git+”安装可能很慢,建议通过 zip 文件安装:
pip install https://github.com/user/repository/archive/branch.zip
Run Code Online (Sandbox Code Playgroud)
或者,我建议您可以使用该.whl
文件进行安装(如果存在)。
pip install https://github.com/user/repository/archive/branch.whl
Run Code Online (Sandbox Code Playgroud)
这是一种非常新的格式,比egg 文件更新。它需要wheel和setuptools>=0.8包。您可以在此处找到更多信息。
归档时间: |
|
查看次数: |
373835 次 |
最近记录: |