Skip to content

Doc inaccurate #51

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

Open
jlmeunier opened this issue Feb 17, 2025 · 3 comments
Open

Doc inaccurate #51

jlmeunier opened this issue Feb 17, 2025 · 3 comments

Comments

@jlmeunier
Copy link

Hi,

The documentation is inaccurate for my installation.

import yaml_include
--> ModuleNotFoundError: No module named 'yaml_include'

import yamlinclude
OK
but AttributeError: module 'yamlinclude' has no attribute 'Constructor'

I had to do:
yaml.add_constructor("!inc", yamlinclude.YamlIncludeConstructor("pypath"))

The versions I use are below.

JL

Python 3.11.11

conda list |grep yaml
pyyaml 6.0.2 py311h9ecbd09_1 conda-forge
pyyaml-include 1.3 pyhd8ed1ab_1 conda-forge
yaml 0.2.5 h7b6447c_0

@tanbro
Copy link
Owner

tanbro commented Feb 18, 2025

The package name of pyyaml-include 1.x is yamlinclude, while in 2.x, it is yaml_include.
You may update it:

pip install -U pyyaml-include

Note

v2 is not compatible with v1!

@jlmeunier
Copy link
Author

Oh, I see, thanks! Now it works fine. Not sure how I manage to get the version 1. My mistake, sorry.

BTW, I initially wanted to use your pyyaml-include "indirectly", via OmegaConf.
OmegaConf uses yaml internally, and I hoped to add a constructor globally from my main. But it does not work. If you have any idea or hint, please share! :-)

JL

@tanbro
Copy link
Owner

tanbro commented Feb 20, 2025

I see OmegaConf works with pyyaml-include 1.x. Can we pin it in the requirements.txt(eg: pyyaml-include~=1.4) ?

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

No branches or pull requests

2 participants