ImportError: No module named django.core.wsgi
export PYTHONPATH="/usr/local/lib/python3.6/site-packages"
AttributeError: 'module' object has no attribute 'lru_cache'
WSGIScriptAlias / /www/settings/wsgi.py
Hi,
Normally you shouldn't have to add site-packages in the PYTHONPATH since it is supposed to be already. If not, packages installed via "sudo pip install" would not be found.
I've packaged a lot of applications in Docker containers, and never had to modify
PYTHONPATH.
Your problem is maybe be lurking elsewhere than PYTHONPATH, and this change has just created a new one which is hiding the original one, but not solving it at all.
Best
I’m not familiar with Docker, but I did have to add the path to Python 3.6 DLLs in my WSGI configuration in my Apache configuration file.
WSGIPythonPath ${project_path};${virtualenv};C:/Python36/DLLs;
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/AM5P193MB008328E4760DBF0DA724D2238CF50%40AM5P193MB0083.EURP193.PROD.OUTLOOK.COM.
Maybe it works like this in Windows (I don't know since having left this world since long now), but Greng mentioned a Debian environment inside his Docker container. Hence my remark.
By the way you mentioned "DLLs". Geng's trouble seems to be related to Python packages finding, not binary libs. In Linux, they are governed by different search paths.
Eric