> On 21 Jan 2019, at 9:58 pm, Eric Demarqui <[email protected]> wrote:
> 
> Hi
> 
> I have an application using Flask server which is running fine.
> 
> I want to use  now Apache with mod_wsgi on this environment : Apache/2.4.6 
> (Red Hat Enterprise Linux) mod_wsgi/4.6.5 Python/3.7 
> 
> Here is how my wsgi.conf file looks like :
> 
> <VirtualHost *>
>     ServerName xxxxxx
> 
>     WSGIDaemonProcess pythonapi user=apache group=apache processes=1 
> threads=5 home=/var/www/html/pythonapi 
> python-path=/usr/local/lib/python3.7/site-packages

Are you using system package for mod_wsgi, or are you compiling from source 
code yourself? The system mod_wsgi package is not going to be for Python 3.7. 
You would need to uninstall the system package to be able to compile mod_wsgi 
from source code. So how did you install mod_wsgi?

Next issue is that you shouldn’t use python-path to refer to a site-packages 
directory like that, especially not one in the actual Python installation. If 
you need to be referring to the one for the actual Python installation, it 
generally indicates something is wrong with your setup.

If using a Python virtual environment you should be using python-home. See:

https://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html 
<https://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html>

Even if not using a virtual environment. If the Python is in a non standard 
location, you should also use python-home but in that case referring to 
sys.path value for the main Python installation and not that of a virtual 
environment.

I would suggest though when using daemon mode, to add at global scope outside 
of the VirtualHost:

    WSGIRestrictEmbedded On

This ensures you are using daemon mode.

So first up, it looks a bit like you are mixing mod_wsgi compiled for one 
Python version/installation, with a different Python version or virtual 
environment created from a different version.

Beyond that, because you are RHEL, it could be a SELinux issue, but first 
confirm how your mod_wsgi is installed.

>     WSGIProcessGroup pythonapi
> 
>     WSGIScriptAlias /servicebotpy /var/www/html/pythonapi/servicebotpy.wsgi
> 
>     <Directory /var/www/html/pythonapi>
>          WSGIApplicationGroup %{GLOBAL}
>          Options Indexes MultiViews FollowSymlinks
>          AllowOverride None
>          Require all granted
>     </Directory>
> </VirtualHost>
> 
> mod_wsgi is compiled with same version as of python3.7
> 
> I am stucked here . 
> 
> [Mon Jan 21 10:32:45.881625 2019] [wsgi:error] [pid 22328] [remote 
> 10.222.160.228:49260]   File "/var/www/html/pythonapi/scorer.py", line 5, in 
> <module>
> [Mon Jan 21 10:32:45.881632 2019] [wsgi:error] [pid 22328] [remote 
> 10.222.160.228:49260]     from sklearn.feature_extraction.text import 
> TfidfVectorizer
> [Mon Jan 21 10:32:45.881656 2019] [wsgi:error] [pid 22328] [remote 
> 10.222.160.228:49260] ModuleNotFoundError: No module named 
> 'sklearn.feature_extraction'
> 
> Thanks for help
> Eric
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/modwsgi 
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to