在bash终端上跑conda update conda
,下面是追溯。
我对安装有什么问题有所了解吗?
yusuf@yusuf-pc2:~$ conda update conda
Traceback (most recent call last):
File "/usr/local/bin/conda", line 11, in <module>
load_entry_point('conda==4.2.7', 'console_scripts', 'conda')()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 567, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2612, in load_entry_point
return ep.load()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2272, in load
return self.resolve()
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2278, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/local/lib/python2.7/dist-packages/conda/cli/__init__.py", line 8, in <module>
from .main import main # NOQA
File "/usr/local/lib/python2.7/dist-packages/conda/cli/main.py", line 46, in <module>
from ..base.context import context
File "/usr/local/lib/python2.7/dist-packages/conda/base/context.py", line 18, in <module>
from ..common.configuration import (Configuration, MapParameter, PrimitiveParameter,
File "/usr/local/lib/python2.7/dist-packages/conda/common/configuration.py", line 40, in <module>
from ruamel.yaml.comments import CommentedSeq, CommentedMap # pragma: no cover
ImportError: No module named ruamel.yaml.comments
yusuf@yusuf-pc2:~$
ruamel包裹的位置:
/home/yusuf/anaconda2/lib/python2.7/site-packages/ruamel_yaml/comments.py
/home/yusuf/anaconda2/lib/python2.7/site-packages/ruamel_yaml/comments.pyc
需要纠正路径。有关如何修复的想法吗?
答案 0 :(得分:1)
从Argonauts(superuser.com)获得解决方案:
看起来你的安装了两个anaconda实例 系统。一个安装到/ usr / local /,另一个安装到你家 。目录
从bash shell中,使用以下命令修改路径(暂时):
export PATH =&#34; / home / yusuf / anaconda2 / bin:$ PATH&#34;
然后再次尝试更新:
conda update conda
那应该解决这个问题。然后,您可以添加导出路径... 排到〜/ .bashrc文件的底部,修复将是 持久性。
假设我猜对了这个问题的原因, 您将要删除重复的安装 - 只要其他没有 系统用户正在使用它。
在正常情况下清理重复的安装问题 您可以简单地删除不需要的anaconda安装的情况 删除它 - 但是因为你已将它安装到/ usr / local / you 需要非常小心 - 可能会安装其他应用程序 那个目录。只需重命名/ usr / local / bin / conda即可 /usr/local/bin/old.conda和每个/ usr / local / bin / python相同* 进入应该足以防止使用该安装,但它远远不够 从一个完美的解决方案。
来源:https://superuser.com/questions/1159792/conda-traceback-no-module-named-ruamel-yaml-comments