close

[Solved] Conda ‘ImportError: No module named ruamel.yaml.comments’

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Conda ‘ImportError: No module named ruamel.yaml.comments’ in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Conda ‘ImportError: No module named ruamel.yaml.comments’ Error Occurs?

Today I get the following error Conda ‘ImportError: No module named ruamel.yaml.comments’ in python.

How To Solve Conda ‘ImportError: No module named ruamel.yaml.comments’ Error ?

  1. How To Solve Conda 'ImportError: No module named ruamel.yaml.comments' Error ?

    To Solve Conda 'ImportError: No module named ruamel.yaml.comments' Error The alternative would be to switch to using python and pip without conda, that way you can just use the latest version of software from PyPI.

  2. Conda 'ImportError: No module named ruamel.yaml.comments'

    To Solve Conda 'ImportError: No module named ruamel.yaml.comments' Error The alternative would be to switch to using python and pip without conda, that way you can just use the latest version of software from PyPI.

Solution 1

The module ruamel.yaml.comments will normally be loaded from site-packages/ruamel/yaml/comments.py, and not from site-packages/ruamel_yaml/comments.py

Conda seems to have problems with properly supporting namespaces (ruamel.) which I can only attribute to not (yet) being fully pip compatible. That although “namespaces are a honking good idea”, and package namespaces have been around for many years.

Assuming you can extend “conda” installations with pip you could try to do a normal install of ruamel.yaml with:

 pip install ruamel_yaml==0.11.14

I would not normally recommend such an old version, but that is more likely to work in combination with the version conda uses itself internally.

The alternative would be to switch to using python and pip without conda, that way you can just use the latest version of software from PyPI.

Solution 2


Try pip install ruamel.yaml

It works for me.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read