I am using mod_wsgi with Apache2
it have a folder common_modules with a module named common_mysql inside it
there is following line in wsgi.py (called by apache2 via mod_wsgi)
my project is in /root/projects/skl
import common_modules.common_mysql
when I run project from browser it gives following error in apache2 error logs
[Sun Jan 21 13:34:36.918272 2024] [wsgi:error] [pid 15612] [remote 127.0.0.1:59976] ModuleNotFoundError: No module named 'common_modules.common_mysql'
if I use python3 interactive shell following works without error
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.insert(0,'/root/projects/skl')
>>> import common_modules.common_mysql
if I run wsgi.py from shell, it gives no error\
I have __init__.py in project folder and subfolders.
Why mode_wsgi behave differenly and gives error?