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

yaml version out of date #62

Open
Yi-FanLi opened this issue Nov 20, 2023 · 1 comment
Open

yaml version out of date #62

Yi-FanLi opened this issue Nov 20, 2023 · 1 comment

Comments

@Yi-FanLi
Copy link

When using the following package versions:
Package Version


bcrypt 4.0.1
certifi 2023.11.17
cffi 1.16.0
charset-normalizer 3.3.2
cryptography 41.0.5
dargs 0.4.3
deepks 0.2.dev79+g7978b39
dpdispatcher 0.6.2
idna 3.4
numpy 1.26.2
paramiko 3.3.1
pip 23.3
pycparser 2.21
PyNaCl 1.5.0
PyYAML 6.0.1
requests 2.31.0
ruamel.yaml 0.18.5
ruamel.yaml.clib 0.2.8
setuptools 68.0.0
tqdm 4.66.1
typeguard 4.1.5
typing_extensions 4.8.0
urllib3 2.1.0
wheel 0.41.2

The following error will occur:

Traceback (most recent call last):
File "/opt/mamba/envs/deepks/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/mamba/envs/deepks/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/opt/mamba/envs/deepks/lib/python3.10/site-packages/deepks/main.py", line 11, in
main_cli()
File "/opt/mamba/envs/deepks/lib/python3.10/site-packages/deepks/main.py", line 37, in main_cli
sub_cli(args.args)
File "/opt/mamba/envs/deepks/lib/python3.10/site-packages/deepks/main.py", line 254, in iter_cli
argdict = deep_update(argdict, load_yaml(fl))
File "/opt/mamba/envs/deepks/lib/python3.10/site-packages/deepks/utils.py", line 138, in load_yaml
res = yaml.safe_load(fp)
File "/opt/mamba/envs/deepks/lib/python3.10/site-packages/ruamel/yaml/main.py", line 1105, in safe_load
error_deprecation('safe_load', 'load', arg="typ='safe', pure=True")
File "/opt/mamba/envs/deepks/lib/python3.10/site-packages/ruamel/yaml/main.py", line 1039, in error_deprecation
raise AttributeError(s, name=None)
AttributeError:
"safe_load()" has been removed, use

yaml = YAML(typ='safe', pure=True)
yaml.load(...)

instead of file "/opt/mamba/envs/deepks/lib/python3.10/site-packages/deepks/utils.py", line 138

    res = yaml.safe_load(fp)

The safe_load and safe_dump functions used in deepks/utils.py has been deprecated since yaml 0.15.0. See https://yaml.readthedocs.io/en/latest/api/. We should think about update the supported version of yaml package.

@y1xiaoc
Copy link
Collaborator

y1xiaoc commented Nov 21, 2023

Good catch! Do you want to write a PR for this?

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