I switched from PyCharm to VSCode. Now, I have a problem importing a modules within the same package.
main.py
from importlib_resources import files
import household_prices.data.raw_data as raw_data # <- moudle not found
source = files(raw_data).joinpath("household_price.csv")
df = pd.read_csv(source)
I think it has to do with the python path. When I call sys.path
in PyCharm, I have both ~/code/household_prices/household_prices/analysis
and ~/code/household_prices/household_prices
.
The second path is missing in VSCode. Is there an automated way to always incude the root of the package in the python path?
folder structure
* household_prices
* .idea
* household_prices
* analysis
* __init__.py
* main.py
* data/
* __init__.py
* raw_data/
* __init__.py
* household_price.csv
* README.md