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 |