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

[BUG] CP2K module cannot use in python 3.10 #1019

Closed
likefallwind opened this issue Nov 2, 2022 · 1 comment · Fixed by #1020
Closed

[BUG] CP2K module cannot use in python 3.10 #1019

likefallwind opened this issue Nov 2, 2022 · 1 comment · Fixed by #1020
Assignees
Labels
bug Something isn't working

Comments

@likefallwind
Copy link
Member

Summary

CP2K module cannot use in python 3.10.

DPGEN Version and Platform

Bohrium Platform
DP-GEN version: 0.10.6

Expected Behavior

Just run CH4 example

Actual Behavior

Traceback (most recent call last):
File "/opt/miniconda/envs/deepmd/bin/dpgen", line 8, in
sys.exit(main())
File "/opt/miniconda/envs/deepmd/lib/python3.10/site-packages/dpgen/main.py", line 185, in main
args.func(args)
File "/opt/miniconda/envs/deepmd/lib/python3.10/site-packages/dpgen/generator/run.py", line 3642, in gen_run
run_iter (args.PARAM, args.MACHINE)
File "/opt/miniconda/envs/deepmd/lib/python3.10/site-packages/dpgen/generator/run.py", line 3625, in run_iter
make_fp (ii, jdata, mdata)
File "/opt/miniconda/envs/deepmd/lib/python3.10/site-packages/dpgen/generator/run.py", line 2827, in make_fp
make_fp_cp2k(iter_index, jdata)
File "/opt/miniconda/envs/deepmd/lib/python3.10/site-packages/dpgen/generator/run.py", line 2686, in make_fp_cp2k
cp2k_input = make_cp2k_input(sys_data, fp_params)
File "/opt/miniconda/envs/deepmd/lib/python3.10/site-packages/dpgen/generator/lib/cp2k.py", line 159, in make_cp2k_input
update_dict(default_config, user_config)
File "/opt/miniconda/envs/deepmd/lib/python3.10/site-packages/dpgen/generator/lib/cp2k.py", line 69, in update_dict
if (k in old_d and isinstance(old_d[k], dict) and isinstance(update_d[k], collections.Mapping)):
AttributeError: module 'collections' has no attribute 'Mapping'

Steps to Reproduce

Use python 3.10 to run dpgen.

It is because module 'collections' has no attribute 'Mapping' in python 3.10, while it is use in dpgen/generator/lib/cp2k.py

@likefallwind likefallwind added the bug Something isn't working label Nov 2, 2022
@njzjz
Copy link
Member

njzjz commented Nov 2, 2022

It should be changed to collections.abc.Mapping.

@likefallwind likefallwind self-assigned this Nov 2, 2022
wanghan-iapcm pushed a commit that referenced this issue Nov 4, 2022
python3.10 support: collection.Mapping -> collection.abc.Mapping

repair this: #1019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants