Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ruamel_yaml conda compatibility #48

Closed
wants to merge 1 commit into from
Closed

Conversation

sangramga
Copy link

In case of importError or ModuleNotFoundError. Solved issue Solved issue https://github.com/jupyterhub/jupyterhub/issues/3145

In case of `importError` or `ModuleNotFoundError`
@elgalu
Copy link

elgalu commented Aug 18, 2020

yep, this fixes the issue

@Zsailer
Copy link
Member

Zsailer commented Aug 18, 2020

@sangramga - thank you for diving into this issue!

Can you explain the issue here a bit more? Is the problem that conda installs ruamel.yaml under a different package name than pip, i.e. ruamel_yaml instead of ruamel.yaml? If so, I'm assuming the reason is that conda doesn't handle package namespaces the same way as PyPI.

This makes me a bit uneasy. There is no guarantee that ruamel.yaml and ruamel_yaml are equal (e.g. the conda package may not stay up to date) and users could have both installed simultaneously. This might lead to issues that are difficult to debug...

For now, I think this solution addresses the issue, but we'll need to keep a lookout for bugs that might arise from this difference in package names.

@minrk
Copy link
Member

minrk commented Aug 20, 2020

This is frustrating. It is not a backward/forward compatibility issue because ruamel_yaml and ruamel.yaml are not the same package. ruamel_yaml is a conda-only fork by Anaconda of ruamel.yaml (more info here). But the real problem is that while it is an incompatible fork, the conda package for ruamel installs pip metadata for ruamel-yaml, which according to pip package normalization is the same as ruamel.yaml. The result is that when you have ruamel_yaml you do not have ruamel.yaml, but pip thinks you do.

The fix should be in the ruamel_yaml conda package to avoid the conflicting metadata (I believe I fixed this in conda-forge/ruamel_yaml-feedstock#68). We can have this fallback here to accept the reality of the conda confusion, but I don't really think it's the 'right' way to fix it.

The other workaround, since this is a conda-packaging bug, is to install the 'true' ruamel.yaml with conda:

conda install ruamel.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants