yaml 'module' has no attribute 'Dumper'
See original GitHub issueOn latest develop, I’m getting the following backtrace when installing (python setup.py install):
File "/xxxxxxxxx/salt/salt/utils/jinja.py", line 35, in <module>
class OrderedDictDumper(yaml.Dumper):
AttributeError: 'module' object has no attribute 'Dumper'
This patch fixes it, but I’m not sure it’s the correct solution: https://github.com/mgwilliams/salt/compare/yaml-dumper
Oddly, I can run this from a bash prompt just fine:
echo "import yaml; yaml.Dumper(None, None)" | python
Issue Analytics
- State:
- Created 10 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
AttributeError: module 'yaml' has no attribute 'dump'
It always errors out with AttributeError: module 'yaml' has no attribute 'dump' according to the documentation that should work fine.
Read more >PyYAML Documentation
Dumping YAML dump accepts the second optional argument, which must be an open text or binary file. In this case, yaml. dump will...
Read more >About - | notebook.community
ruamel.yaml supports YAML 1.2 and has round-trip loaders and dumpers that ... 1 code.keys() AttributeError: 'CommentedSeq' object has no attribute 'keys'.
Read more >ruamel.yaml — Python YAML package documentation
Output of dump() as a string · Departure from previous API · Loading · Dumping a multi-documents YAML stream · Dumping · Transparent...
Read more >YAML Deserialization Attack in Python - Net Square
PyYAML is a third-party python module that deals with YAML serialization and deserialization ... SafeDumper by default and Dumper is not user-controllable.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top 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
As I see this is quite an old error. But I happened to run in the exact same error while importing omegaconf.
PyYAML version was 5.4.1, and downgrading it to 5.4.0 worked! Weird 😃
I just hit this same problem… The fix required me to remove a residual
yaml.pyleft over from a previous build in the./build/lib.linux-x86_64-2.7/salt/utils/build directory.python setup.py buildshould probably delete everything in the target directories before generating their contents over again in order that cruft files are removed.python setup.py cleandoes not seem to remove old cruft*.pyfiles either.