Apache2 error.log:
[Thu Dec 17 18:58:33 2015] [warn] mod_wsgi: Compiled for Python/2.7.2+.
[Thu Dec 17 18:58:33 2015] [warn] mod_wsgi: Runtime using Python/2.7.3.
[Thu Dec 17 18:58:33 2015] [notice] Apache/2.2.22 (Ubuntu) mod_ssl/2.2.22 OpenSSL/1.0.1 mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations
ImportError: No module named site
My python version:
python --version
Python 2.7.5
Apache2 config:
WSGIPythonHome /opt/pkgs
And I can import site:
me@localhost:/opt/pkgs/python/bin$ python
Python 2.7.5 (default, Aug 21 2015, 20:17:51)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import site
>>>
me@localhost:/opt/pkgs/python/bin$ python2.7
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import site
>>>
how to fix this problem??? Any helop is welcome. Thanks
UPDATE
site.py is in /opt/pkgs/python/lib/python2.7 How to set WSGIPythonHome?
Why "WSGIPythonHome /usr" works for me????
For ones that step on this question (like me) because you are facing a problem with endless:
in apache's error.log (/var/log/apache2/error.log)
most probably you have
WSGIPythonHome
pointing to some other (presumably) python location. Default setting IS:And what people forget to mention is where this supposed to be it is in:
this file usually starts with:
Somewhere there you put:
or
or (the best option) remove or comment this setting because /usr suppose to be default setting and use built in python.
or
change, mess up or fix what ever you have messed up with wsgi configuration (like I do when I try to make something work or break and do not know enough ;) )