Hi everyone. am a beginner in python and trying to run script called “swatpy” but this error occurs. pls how can this issue be resolved? and I will appreciate anyone with experience using the swatpy package.
ImportError Traceback (most recent call last)
Input In [1], in <cell line: 4>()
2 import pandas as pd
3 import swatpy
----> 4 from swatpy import io
ImportError: cannot import name ‘io’ from ‘swatpy’ (/home/eoafrica/.local/lib/python3.8/site-packages/swatpy/init.py)
You’ve named your own script swatpy.py but then tried to import swatpy inside it. Due to the way that Python imports work, that means you’re importing your own script rather than the library you intended to import. I recommend renaming your own script and then removing any swatpy files from the __pycache__ directory nearby, and then trying again.