microsoft / BatteryML

MIT License
480 stars 101 forks source link

Import issue when running `preprocess.py` | `ModuleNotFoundError: No module named 'src'` #7

Closed tanevitt closed 1 year ago

tanevitt commented 1 year ago

From the top-level directory I run:

python scripts/preprocess.py 

The status bar gets to 50% and then I get the following error:

line 11, in <module>
    from src import BatteryData, CycleData, CyclingProtocol
ModuleNotFoundError: No module named 'src'

Seems like a pathing issue with locating the src directory.

Running Python 3.9.17 on a Mac.

fingertap commented 1 year ago

Try adding the project folder to PYTHONPATH:

cd path/to/BatteryML
PYTHONPATH=. python scripts/preprocess.py