BUG: atomate2 0.0.23 ImportError 'LobsterSet' from 'pymatgen.io.vasp.sets'
# atomate2 0.0.23 ImportError: cannot import name 'LobsterSet' from 'pymatgen.io.vasp.sets'
## Issue Description
atomate2 version 0.0.23 has an import error when trying to import `LobsterSet` from `pymatgen.io.vasp.sets`. This occurs because the latest version of pymatgen (2026.3.23) has removed or renamed the `LobsterSet` class, but atomate2 0.0.23 still attempts to import it.
## Steps to Reproduce
1. Install the latest versions:
```bash
pip install atomate2==0.0.23
pip install pymatgen # installs 2026.3.23
```
2. Try to import atomate2:
```python
from atomate2.vasp.flows.core import DoubleRelaxMaker
```
3. Observe the import error:
```
ImportError: cannot import name 'LobsterSet' from 'pymatgen.io.vasp.sets'
```
## Environment Information
- **atomate2 version**: 0.0.23
- **pymatgen version**: 2026.3.23
- **Python version**: 3.12
- **Operating System**: Linux
- **Installation method**: pip
## Expected Behavior
atomate2 should import successfully without errors, or provide a clear error message if there are dependency conflicts.
## Actual Behavior
Import fails with:
```python
Traceback (most recent call last):
File "/path/to/atomate2/vasp/flows/core.py", line 12, in <module>
from atomate2.vasp.jobs.core import (
File "/path/to/atomate2/vasp/jobs/core.py", line 14, in <module>
from atomate2.vasp.sets.core import (
File "/path/to/atomate2/vasp/sets/core.py", line 12, in <module>
from pymatgen.io.vasp.sets import LobsterSet
ImportError: cannot import name 'LobsterSet' from 'pymatgen.io.vasp.sets' (/path/to/pymatgen/io/vasp/sets.py)
```
## Workaround
Downgrade to compatible versions:
```bash
pip install atomate2==0.0.22 pymatgen==2025.6.14
```
This resolves the issue, but it's not a long-term solution.
## Root Cause Analysis
The issue appears to be caused by:
1. **Version incompatibility**: atomate2 0.0.23 expects `LobsterSet` to exist in pymatgen
2. **API changes in pymatgen**: The latest pymatgen (2026.3.23) has removed or renamed `LobsterSet`
3. **Missing dependency constraints**: atomate2's dependencies don't properly constrain pymatgen versions
## Suggested Solutions
### Option 1: Update atomate2 to support latest pymatgen
- Update the import statements to handle the absence of `LobsterSet`
- Provide fallback or alternative implementations
- Update dependency constraints in setup.py/pyproject.toml
### Option 2: Add proper dependency constraints
- Add upper bound for pymatgen in atomate2's dependencies
- Ensure compatibility with specific pymatgen versions
- Provide clear version compatibility matrix
### Option 3: Graceful degradation
- Make `LobsterSet` import optional
- Provide clear error messages when dependencies are incompatible
- Document version requirements clearly
## Additional Context
This issue affects users who:
- Install atomate2 from pip
- Use the latest pymatgen version
- Try to use atomate2 workflows for VASP calculations
The workaround (downgrading) works but prevents users from benefiting from the latest pymatgen features and bug fixes.
## Priority
**High** - This is a breaking change that prevents basic usage of atomate2 with current pymatgen versions.
## References
- atomate2 version: 0.0.23
- pymatgen version: 2026.3.23
- Error location: `atomate2/vasp/sets/core.py` line 12
关闭于 2026-03-26 2 条评论