Pythonconda 回溯:没有名为 ruamel.yaml.comments 的模块
Python conda traceback: No module named ruamel.yaml.comments
运行 conda update conda
在 bash 终端上,下面是回溯。
知道我的安装有什么问题吗?
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
路径需要更正。知道如何解决吗?
从 Argonauts (superuser.com) 那里得到了解决方案:
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.
From the bash shell, modify your path (temporarily) with this command:
export PATH="/home/yusuf/anaconda2/bin:$PATH"
Then try updating again:
conda update conda
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.
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
运行 conda update conda
在 bash 终端上,下面是回溯。
知道我的安装有什么问题吗?
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
路径需要更正。知道如何解决吗?
从 Argonauts (superuser.com) 那里得到了解决方案:
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.
From the bash shell, modify your path (temporarily) with this command:
export PATH="/home/yusuf/anaconda2/bin:$PATH"
Then try updating again:
conda update conda
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.
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