You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm the author of YAtiML, a Python library for mapping YAML to objects and back that uses the ruamel.yaml Python library. My users are reporting a dependency issue with YAtiML if they have Anaconda installed and the base environment activated.
The Anaconda installer installs a ruamel_yaml package into the base environment by default. This is a patched and renamed version of the ruamel.yaml (note, period, not underscore) Python library for reading and writing YAML files. Pip follows PEP 503 when looking up packages, which specifies that package names must be normalised by replacing each run of period, dash and underscores with a single dash. As a result, if Anaconda is installed and the base environment is enabled (which the user may have set as the default when installing), pip will fail to install ruamel.yaml because it looks up ruamel-yaml and finds that it is already available, ruamel_yaml normalising to the same name. As a result, any pip-installed programs with ruamel.yaml in their dependencies will crash with a ModuleNotFoundError when trying to import ruamel.yaml if the Anaconda base environment is active.
A patch which changes the python package name to ruamel_yaml_conda was recently applied to the conda-forge version to fix this issue. I'm not sure how the conda-forge issue and the Anaconda version are related (conda-forge packages an older version of ruamel.yaml, so it doesn't seem to be an upstream?), but perhaps the same could be done for the version in the default channel?
Actual Behavior
~$ docker run -ti continuumio/anaconda3 /bin/bash
Unable to find image 'continuumio/anaconda3:latest' locally
latest: Pulling from continuumio/anaconda3
852e50cd189d: Already exists
864e1e8957d3: Pull complete
6d4823199f64: Pull complete
Digest: sha256:0b2047cdc438807b87d53272c3d5b10c8238fe65a2fedf9bd72de0b7ba360cb1
Status: Downloaded newer image for continuumio/anaconda3:latest
(base) root@946f81a105b0:/# pip install ruamel.yaml
Requirement already satisfied: ruamel.yaml in /opt/conda/lib/python3.8/site-packages (0.15.87)
(base) root@946f81a105b0:/# python -c 'import ruamel.yaml'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'ruamel'
Hi, I'm the author of YAtiML, a Python library for mapping YAML to objects and back that uses the
ruamel.yaml
Python library. My users are reporting a dependency issue with YAtiML if they have Anaconda installed and the base environment activated.The Anaconda installer installs a
ruamel_yaml
package into the base environment by default. This is a patched and renamed version of theruamel.yaml
(note, period, not underscore) Python library for reading and writing YAML files. Pip follows PEP 503 when looking up packages, which specifies that package names must be normalised by replacing each run of period, dash and underscores with a single dash. As a result, if Anaconda is installed and the base environment is enabled (which the user may have set as the default when installing), pip will fail to installruamel.yaml
because it looks upruamel-yaml
and finds that it is already available,ruamel_yaml
normalising to the same name. As a result, any pip-installed programs withruamel.yaml
in their dependencies will crash with aModuleNotFoundError
when trying toimport ruamel.yaml
if the Anaconda base environment is active.There is some discussion as to the history of ruamel_yaml here, although most of it seems to have been lost when the author of ruamel.yaml moved it from BitBucket to SourceForge. See also a related issue in conda/conda and a related issue for pip.
To make things a bit more complicated, there is also a ruamel_yaml package on conda-forge (feedstock), which packages a different obsolete version of ruamel.yaml, as well as a ruamel.yaml conda-forge package (feedstock) which seems to have the latest version.
A patch which changes the python package name to
ruamel_yaml_conda
was recently applied to the conda-forge version to fix this issue. I'm not sure how the conda-forge issue and the Anaconda version are related (conda-forge packages an older version of ruamel.yaml, so it doesn't seem to be an upstream?), but perhaps the same could be done for the version in the default channel?Actual Behavior
Expected Behavior
Steps to Reproduce
See above. Here's a more detailed version which clearly demonstrates that
ruamel_yaml
is the cause of the problem:~$ docker run -ti continuumio/anaconda3 /bin/bash
(base) root@9fb570b326be:/# conda create --name=env python=3.8
(base) root@9fb570b326be:/# conda activate env
(env) root@9fb570b326be:/# pip install ruamel.yaml
(env) root@9fb570b326be:/# python -c 'import ruamel.yaml'
(no error)
(env) root@9fb570b326be:/# pip uninstall ruamel.yaml ruamel.yaml.clib
(env) root@9fb570b326be:/# conda install ruamel_yaml
(env) root@9fb570b326be:/# pip install ruamel.yaml
(env) root@9fb570b326be:/# python -c 'import ruamel.yaml'
Anaconda or Miniconda version:
Latest Docker image, which seems to contain the 2020.11 release.
Operating System:
Ubuntu 18.04, or probably more usefully whatever's in that Docker container.
conda info
(This is inside the base environment, in which the issue can be reproduced by default.)
conda list --show-channel-urls
Again in the base environment:
The text was updated successfully, but these errors were encountered: