As part of a major refactoring in ASE 3.27, the NEB class has been completely moved from the ase.neb module to the ase.mep module. This change was previously announced as a Deprecation Warning starting from ASE 3.23.
If you encounter an ImportError or ModuleNotFoundError in your existing scripts, please refer to the following guide to fix it.
Error Details
In ASE 3.27 and later, attempting to import NEB from ase.neb will result in the following error:
Error (Text Transcript):
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 2
1 from ase.build import molecule
----> 2 from ase.neb import NEB
4 initial = molecule('NH3')
6 final = initial.copy()
ModuleNotFoundError: No module named 'ase.neb'
Solution
Update your import statements to use the new mep (Minimum Energy Path) module.
Before:
from ase.build import molecule
from ase.neb import NEB ##### Cause of Error #####
initial = molecule('NH3')
final = initial.copy()
final.positions[0, 2] *= -1
images = [initial, final]
neb = NEB(images)
After:
from ase.build import molecule
from ase.mep import NEB ##### Fixed #####
initial = molecule('NH3')
final = initial.copy()
final.positions[0, 2] *= -1
images = [initial, final]
neb = NEB(images)
Reference Infomation
The deprecation warning message was displayed as follows in previous versions. This warning appeared when instantiating the NEB class imported from the old ase.neb module.
When running on ASE 3.23 – 3.26:
Warning message (Text Transcript)
DeprecationWarning: Please import NEB from ase.mep instead of ase.neb
Related Information
ASE Documentation: Nudged Elastic Band
https://ase-lib.org/ase/neb.html#module-ase.mep.nebMerge Request !2974: Consolidate MEP modules
For more details on why this was moved to themepmodule, please see here.
https://gitlab.com/ase/ase/-/merge_requests/2974