Git,Conda - 我如何 "pip install git+git:<repo>" 实施新的 Git 政策?

Git, Conda - How can I "pip install git+git:<repo>" with the new Git policies in place?

我有这个 conda yml 文件,用于安装依赖项和创建新的 conda 环境。

conda_env.yml 分叉自 https://github.com/MishaLaskin/rad:

name: rad
channels:
  - defaults
dependencies:
  - python=3.6
  - pytorch
  - torchvision
  - cudatoolkit=9.2
  - absl-py
  - pyparsing
  - pillow=6.1
  - pip:
    - termcolor
    - git+git://github.com/deepmind/dm_control.git
    - git+git://github.com/1nadequacy/dmc2gym.git
    - tb-nightly
    - imageio
    - imageio-ffmpeg
    - torchvision
    - scikit-image
    - tabulate

我尝试 运行 conda env create --file conda_env.yml 这是我得到的堆栈跟踪。

Collecting package metadata (repodata.json): done
Solving environment: done
Installing pip dependencies: - Ran pip subprocess with arguments:
['/home/dyung6/anaconda3/envs/rad/bin/python', '-m', 'pip', 'install', '-U', '-r', '/home/dyung6/rad/condaenv.835gcx7g.requirements.txt']
Pip subprocess output:
Collecting git+git://github.com/deepmind/dm_control.git (from -r /home/dyung6/rad/condaenv.835gcx7g.requirements.txt (line 2))
  Cloning git://github.com/deepmind/dm_control.git to /tmp/pip-req-build-nc4w5hv8

Pip subprocess error:
  Running command git clone -q git://github.com/deepmind/dm_control.git /tmp/pip-req-build-nc4w5hv8
  fatal: remote error:
    The unauthenticated git protocol on port 9418 is no longer supported.
  Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
WARNING: Discarding git+git://github.com/deepmind/dm_control.git. Command errored out with exit status 128: git clone -q git://github.com/deepmind/dm_control.git /tmp/pip-req-build-nc4w5hv8 Check the logs for full command output.
ERROR: Command errored out with exit status 128: git clone -q git://github.com/deepmind/dm_control.git /tmp/pip-req-build-nc4w5hv8 Check the logs for full command output.
                                                                                                                                                                                                               failed

CondaEnvException: Pip failed

似乎新的 git 政策阻止您这样做。反正有这个吗?

正如@torek 指出的那样,错误消息中指向的文档解释说,git:// 协议已在 GitHub 上逐步淘汰。切换到使用 https://,即,在这种情况下:

  - pip:
    - git+https://github.com/deepmind/dm_control.git
    - git+https://github.com/1nadequacy/dmc2gym.git
    ...