且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Python conda追溯:没有名为ruamel.yaml.comments的模块

更新时间:2023-12-05 19:13:34

从Argonauts(superuser.com)获得了一个解决方案:

Got a solution from Argonauts (superuser.com):

您似乎在自己的计算机上安装了两个anaconda实例 系统.一个安装到/usr/local/,另一个安装到您的家庭 目录.

It looks like you have two instances of anaconda installed on your system. One installed to /usr/local/ and the other to your home directory.

在bash shell中,使用以下命令(临时)修改路径:

From the bash shell, modify your path (temporarily) with this command:

export PATH ="/home/yusuf/anaconda2/bin:$ PATH"

export PATH="/home/yusuf/anaconda2/bin:$PATH"

然后尝试再次更新:

conda更新conda

conda update conda

那应该可以解决问题.然后,您可以添加导出路径... 行到〜/.bashrc文件的底部,修复程序将是 持久的.

That should resolve the issue. You can then add the export PATH... line to the bottom of your ~/.bashrc file and the fix will be persistent.

假设我猜对了这个问题的原因, 您将要删除重复的安装-只要没有其他 系统用户正在使用它.

Assuming that I guessed correctly about the cause of this issue, you'll want to remove the duplicate installation - as long no other system users are using it.

要清理重复的安装问题,通常情况下 情况下,您可以通过以下方式删除不需要的anaconda安装: 删除它-但是由于您已将其安装到/usr/local/ 需要非常小心-可能会将其他应用程序安装到 该目录.只需将/usr/local/bin/conda重命名为 /usr/local/bin/old.conda,每个/usr/local/bin/python *都相同 条目应该足以防止使用该安装程序,但是远远不够 完美的解决方案.

To clean up the duplicate installation issue, under normal circumstances you can remove an unwanted anaconda install simply by deleting it - however since you have it installed to /usr/local/ you will need to be very careful - other applications may be installed to that directory. Simply renaming /usr/local/bin/conda to /usr/local/bin/old.conda and the same for each /usr/local/bin/python* entry shoud be enough to prevent that install being used, but it's far from a perfect solution.

来源: https://superuser.com/questions/1159792/conda-traceback-no-module-named-ruamel-yaml-comments