question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot install `ruamel.yaml`: `Can't find a pure Python 3 wheel for ruamel-yaml-clib>=0.2.6`

See original GitHub issue

🐛 Bug

I cannot install ruamel.yaml on Pyodide.

To Reproduce

>>> await micropip.install('ruamel.yaml', keep_going=True)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/lib/python3.10/site-packages/micropip/_micropip.py", line 552, in install
    raise ValueError(
ValueError: Can't find a pure Python 3 wheel for: 'ruamel-yaml-clib>=0.2.6; platform_python_implementation == "CPython" and python_version < "3.11"'
See: https://pyodide.org/en/stable/usage/faq.html#micropip-can-t-find-a-pure-python-wheel

I see that this dependency should only be installed for CPython, but apparently micropip is trying to pull it anyways?

Expected behavior

Installing ruamel.yaml works.

Environment

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:16 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
hoodmanecommented, Sep 6, 2022

it is a bug in micropip which is happening because it canonicalize the requested package name.

I don’t think this is correct. I did the following:

pyodide.loadPackage("micropip");
pyodide.runPythonAsyinc(`import micropip; await micropip.install("ruamel.yaml", deps=False)`);
pyodide.runPython(`
import sys
from ruamel.yaml import YAML
yaml = YAML()
d = dict(a=dict(b=2),c=[3, 4])
yaml.dump(d, sys.stdout)
`);

and it printed:

a:
  b: 2
c:
- 3
- 4

So I think it works fine. If you try without deps=False, then you get an error about ruamel-yaml-clib, which we aren’t building. The solution would be to build ruamel-yaml-clib as well.

1reaction
ryanking13commented, Sep 6, 2022

I found that micropip.install("ruamel.yaml") is still not available though… it is a bug in micropip which is happening because it canonicalize the requested package name.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Import "ruamel.yaml" could not be resolved - Stack Overflow
Whereas when I am trying to import and use it in the python script it is giving me below error. Import "ruamel.yaml" could...
Read more >
ruamel.yaml 0.16.12 - PyPI
ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order.
Read more >
Python YAML package documentation - Read the Docs
ruamel.yaml is a YAML 1.2 loader/dumper package for Python. ... sudo apt-get install python3-dev ... That library doesn't generate.
Read more >
Intro to Python Environments - The Materials Project Workshop
pip is a package management system for python that is used to install and manage ... 1.3.3 rfc3987 1.3.8 robocrys 0.2.7 ruamel.yaml 0.17.10...
Read more >
Install fails on 0.104.3 , wheel failure python 3.7.5 ubuntu ...
Essential sections failing to build, python3.7.5 runing on Odroid XU4 ... bcrypt, pyyaml, ruamel.yaml, voluptuous, voluptuous-serialize, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found