更新时从在 conda 环境中使用 pip 安装的 git 存储库获取新提交

Get new commits from a git repo installed with pip in a conda environment when updating

我正在使用 YAML 配置从 BitBucket 安装一个包到我的 conda 环境中,文件的一个子集如下所示:

# config.yaml

name: ll4ma_opt
channels:
- defaults
- conda-forge
dependencies:
- pip
- pip:
  - git+https://bitbucket.org/robot-learning/ll4ma_util.git

效果很好。我做了 conda env create -f config.yaml,它创造了很好的环境。

我的问题是,当我更改 BitBucket 包 ll4ma_util 时,即使在 conda env update -f config.yaml

之后,我的 conda 环境中也没有得到这些更改

当我尝试进行更新时,我在终端中看到了这个输出:

Pip subprocess output:
Collecting git+https://bitbucket.org/robot-learning/ll4ma_util.git (from -r /home/adam/ll4ma-opt-sandbox/conda/condaenv.65mn0x4h.requirements.txt (line 3))
  Cloning https://bitbucket.org/robot-learning/ll4ma_util.git to /tmp/pip-req-build-5qdqlgww
  Resolved https://bitbucket.org/robot-learning/ll4ma_util.git to commit 9673a4ff2025356a4eff72b0ee44e7f02d76b414

显示的散列实际上是最新的提交,但是当我尝试在更新后使用代码时,它仍在使用旧代码并且没有反映我对 ll4ma_util 包所做的更改。我成功的唯一方法是使用 conda env remove -n ll4ma_opt 完全删除我的环境,然后重新创建它。

有没有一种方法可以强制更新 BitBucket 包,这样如果我在 conda 环境中使用 gitpip 安装包,它将提取并使用任何最近的更改当我 运行 更新我的 conda 环境时从 git 回购?

mentioned elsewhere 一样,要安装支持文件更改(例如存储库拉取)的 Pip,需要 -e 标志。在 Conda YAML 上下文中,您需要:

name: ll4ma_opt
channels:
  - defaults
  - conda-forge
dependencies:
  - pip
  - pip:
    - -e git+https://bitbucket.org/robot-learning/ll4ma_util.git