I have a directory structure like
akom
DB
DBinit.py
__init__.py
server.py
Configuration(dir)
urls.py
settings.py
manage.py
ini.py
__init__.py
I have set the PYTHONPATH in my .bashrc as export PYTHONPATH=$PYTHONPATH:/home/dir1/dir2/
Inside dir2 akom reside.
I am importing the ini.py on server.py like import ini but i am getting the error that
ImportError: No module named ini
Please tell me where i am going wrong .?
Since
akomis a package itself, you need to reference modules inside that package by the package name first – e.g. by usingimport akom.iniinstead ofimport ini.Update: Reading above, it’s somewhat unclear if
ini.pyis in theConfigurationdirectory – if it is you will need to doimport akom.Configuration.ini.