Python conda traceback: no module named ruamel.yaml.comments

Ran conda update conda on a bash terminal and below is a trace.

Any idea what is wrong with my installation?

 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 :~$ 

Package Location 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 

The path must be fixed. Any idea on how to fix it?

0
source share
1 answer

Received a solution from Argonauts (superuser.com):

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

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

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

Then try again:

conda update conda

This should solve the problem. You can then add the PATH export ... to the bottom of your ~ / .bashrc file, and the fix will be persistent.

Assuming that I correctly guessed the cause of this problem, you will want to remove the duplicated installation - as long as there are no other users of the system use it.

To clear up the duplicate installation problem, in normal circumstances, you can remove the unnecessary anaconda installation simply by removing it - however, since you installed it in / usr / local / you will need to be very careful - other applications may be installed for this directory. Just rename / usr / local / bin / conda to /usr/local/bin/old.conda and the same for each / usr / local / bin / python * is enough to prevent this setting from being used, but this is far from perfect solution.

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

+1
source

Source: https://habr.com/ru/post/1013594/


All Articles