如何将 GitHub 中的包的不同分支(基于 python)导入到本地计算机?

How to import different branch of a package(based on python) in GitHub to local computer?

我对在 Google Colab 上导入回购的不同分支有疑问。

Autograd(https://github.com/HIPS/autograd) have a cupy-adaptable version which lies in another branch(https://github.com/HIPS/autograd/tree/cupy).I 想将 autograd(cupy 友好版本导入 google colab 并使用以下命令:

!pip install git+git://github.com/ericmjl/autograd/tree/cupy

但它有以下错误:

Collecting git+git://github.com/ericmjl/autograd/tree/cupy
Cloning git://github.com/ericmjl/autograd/tree/cupy to /tmp/pip-yoasr9_z-build fatal:

remote error: ericmjl/autograd/tree/cupy is not a valid repository name
Email support@github.com for help

Command "git clone -q git://github.com/ericmjl/autograd/tree/cupy /tmp/pip-yoasr9_z-build" failed with error code 128 in None

有没有人可以帮助我?非常感谢!!

这应该有效:pip install git+https://github.com/ericmjl/autograd.git@cupy

参见 VCS support