Cannot load CLoader
See original GitHub issueHi, I’m using pyyaml in a Docker container based on bitnami/minideb:jessie, where python version is 2.7.9.
The original code is using CLoader and I cannot change it. Any reason CLoader fails to load but Loader is fine ?
>>> import yaml
>>> yaml.__version__ '3.12'
>>> from yaml import Loader
>>> from yaml import CLoader Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: cannot import name CLoader
>>>
I cannot figure out what I’m missing here. Any idea ?
Running it from the Docker image python:2.7.9 does not raise any error then:
$ docker run -ti python:2.7.9 bash
#/ python
>>> from yaml import CLoader
>>> from yaml import Loader
>>>
Thanks for your help.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Cannot load CLoader with pyyaml - python - Stack Overflow
The original code is using CLoader and I cannot change it currently. Any reason CLoader fails to load but Loader is fine ?...
Read more >yamlloader - PyPI
This module provides loaders and dumpers for PyYAML. Currently, an OrderedDict loader/dumper is implemented, allowing to keep items order when loading resp.
Read more >PyYAML Documentation
Therefore it is not safe to use Loader to load a document received from an untrusted source. By default, the functions scan ,...
Read more >WP Toolkit shows error: Cannot load the ionCube PHP Loader
WP Toolkit shows error: Cannot load the ionCube PHP Loader – it was already loaded - Support Cases - Plesk Knowledge Base.
Read more >Error: Cannot load into non simple data - Esri Support
This error occurs when the Simple Data Loader is used to load data into a feature class in a relationship class, geometric network,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is because cyaml is optional and requires build dependencies, such as
cython
andyaml.h
to be available upon building the package (yaml.h
comes fromlibyaml-dev
package in Debian/Ubuntu):This is what it prints when
libyaml-dev
is not found when running$ pip --no-cache-dir install --verbose --force-reinstall -I pyyaml
And this is what you’ll see if everything is set up fine:
Thanks for the fix! This worked. But I would propose to add such a statement directly in the error message. So if cyaml cannot be compiled but is accessed, it should not just be an
attribute not found
-error but rather a message telling the above.