我有Win 10
跑步时:
conda update conda
我遇到了这个错误:
RemoveError: 'setuptools' is a dependency of conda and cannot be removed from
conda's operating environment.
似乎没有什么帮助
我尝试卸载 anaconda 并收到成功消息,但似乎旧版本的一些痕迹仍然存在
如何彻底清除Anaconda安装的所有痕迹?
虽然我仍然没有找到如何干净地卸载 anaconda,但我可以使用以下方法解决该错误:
conda update --force conda
conda update anaconda
再一次
conda update conda
结果,我得到了一个稳定的环境,没有依赖冲突。似乎最新的 conda 中的某些内容限制太多,必须强制更新。
我使用的是 Mac,而不是 Windows,但我收到了相同的消息。我可以通过运行
conda update setuptools
进行更新。它使 conda 在此过程中保持最新状态。
我使用的是 Linux Ubuntu 16.04,它对我有用:
conda uninstall setuptools
# This is a must to make it work
conda install setuptools
conda update --force conda
我不是100%确定这是正确的方法,但似乎我设法通过这样做解决了这个问题:
conda update --force -n base -c defaults conda
然后再次使用不带 --force 的相同命令:
conda update -n base -c defaults conda
我在使用 anaconda 安装 scrapy 时遇到问题 ' conda install -c conda-forge scrapy'
我不断收到
'验证事务:失败''RemoveError:'setuptools'是 conda 的依赖项,无法从中删除 conda 的运行环境。'
错误,所以我尝试了上面提到的强制安装设置“conda update --force conda”,一旦成功,我就能够成功重新应用 scrapy 安装。
我在使用
continuumio/miniconda3:latest
的 Dockerfile 中遇到了这个问题,其中有以下行:
RUN conda update -n base -c defaults conda
为了修复它,我只是附加了
setuptools
要求:
RUN conda update -n base -c defaults conda setuptools
不需要任何其他英雄事迹。
在大多数情况下,以下内容应该可以解决此类问题。
conda update conda -n base
conda update --all
conda version: 4.13
(检查:conda --version
)
免责声明:我维护着超过 60 个 conda-forge 包。到目前为止,这个片段基本上让我摆脱了错误。
- GitHub:https://github.com/sugatoray
- Conda-Forge PR:截至日期
作为安全保障,请始终首选从环境规范文件创建 conda 环境:
environment.yml
。
# update a global environment from a file
conda env update -f ./environment.yml --prune
如果您还没有环境定义/规范文件,您可以按如下方式创建一个。 (来源)
## Export a platform independent copy of an environment
# - This will only include packages you installed explicitly.
conda env export --from-history > path/to/environment.yml
conda 求解器可能很慢,当环境求解器完成并安装软件包时,您不必忍受无助地等待的痛苦。
更简单的替代方法是使用
mamba
作为 conda
的直接替代品。方法如下:
conda install -n base mamba -c conda-forge
mamba install -n some_env -c some_channel package1 "package2>=2.1.0"
使用
mamba
更新:
# Global env + Use file
mamba env update -f ./environment.yml --prune