My python projects consists of a number of modules with import statements to each other. In my Eclipse PyDev environment these import statements are working well but when porting it to my Raspberry the runtime environment fails to load the dependent modules.
I have configured PYTHONPATH so that root directory of my project (/home/pi/Desktop/Projects/Catatumbo) is listed in sys.path
:
['/var/www/upload/Projects/Catatumbo',
'/home/pi/Desktop/Projects/Catatumbo',
'/usr/lib/python35.zip',
'/usr/lib/python3.5',
'/usr/lib/python3.5/plat-arm-linux-gnueabihf',
'/usr/lib/python3.5/lib-dynload',
'/home/pi/.local/lib/python3.5/site-packages',
'/usr/local/lib/python3.5/dist-packages',
'/usr/lib/python3/dist-packages']
Project structure looks like:
-core
--adafruit
---forecast (That's where the utility class resides)
-forecast
--adafruit (That's where the script resides)
Though starting the script from project root directory via:
sudo python3 forecast/adafruit/adafruit_forecast.py
still results in the following error:
File "forecast/adafruit/adafruit_forecast.py", line 35, in <module>
from core.adafruit.forecast.forecast_colors import ForecastNeoPixelColors
ImportError: No module named 'core'
Thanks for help!