np.asmatrix函数被废弃使得CIF转POSCAR脚本报错
使用最新版的Miniconda3,python环境的版本是14.x,顺手pip install numpy安装的numpy版本过高,使用vaspkit尝试将.cif文件转换为POSCAR时报错:
1 | AttributeError: `np.mat` was removed in the NumPy 2.0 release. Use `np.asmatrix` instead |
错误原因在于当前的NumPy版本太新(>=2.0),而vaspkit的cif2pos.py脚本中使用了已被移除的np.mat函数,最简单的方式是降级numpy版本:
1 | pip install numpy==1.26.4 |