|
求教一下各位大佬,在pip install pymatgen pymatgen-analysis-diffusion --user 之后,安装到了/home/WHY/.local/lib/python3.9/site-packages路径下.
执行脚本idpp.py,出现报错
File "/home/WHY/bin/idpp.py", line 4, in <module>
from pymatgen.analysis.diffusion.neb.pathfinder import IDPPSolver
ModuleNotFoundError: No module named 'pymatgen.analysis.diffusion'
脚本内容如下,请问我该怎么解决这个问题
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from pymatgen.core import Structure
from pymatgen.analysis.diffusion.neb.pathfinder import IDPPSolver
import numpy as np
import os
import sys
sys.stdout = open(os.devnull, 'w')
if len(sys.argv) <4:
raise SystemError('Sytax Error! Run as python idpp ini/POSCAR fin/POSCAR 4')
init_struct = Structure.from_file(sys.argv[1], False)
final_struct = Structure.from_file(sys.argv[2], False)
obj = IDPPSolver.from_endpoints(endpoints=[init_struct, final_struct], nimages=int(sys.argv[3]),
sort_tol=1.0)
new_path = obj.run(maxiter=5000, tol=1e-5, gtol=1e-3,step_size=0.05,\
max_disp=0.05, spring_const=5.0)
for i in range(len(new_path)):
image_file='{0:02d}'.format(i)
if not os.path.exists(image_file):
os.makedirs(image_file)
POSCAR_file=image_file+'/POSCAR'
new_path.to(fmt="poscar", filename=POSCAR_file)
sys.stdout = sys.__stdout__
#Image Dependent Pair Potential for improved interpolation of NEB initial guess
#Reference: S. Smidstrup, A. Pedersen, K. Stokbro and H. Jonsson, Improved initial guess for minimum energy path calculations, J. Chem. Phys. 140, 214106 (2014).
print("Improved interpolation of NEB initial guess has been generated. BYE.")
|
|