Target WSGI script cannot be loaded as Python module.

Νίκος nikos.at.superhost at gmail.com
Tue May 22 14:29:44 EDT 2018


Hello all,

Iam tryign to run a bootle script iw rote as wsgi app and iam gettign the follwing eroor.

===============================================================
[Tue May 22 06:49:45.763808 2018] [:error] [pid 24298] [client 46.103.59.37:14500] mod_wsgi (pid=24298): Target WSGI script '/home/nikos/public_html/app.py' cannot be loaded as Python module.
[Tue May 22 06:49:45.763842 2018] [:error] [pid 24298] [client 46.103.59.37:14500] mod_wsgi (pid=24298): Exception occurred processing WSGI script '/home/nikos/public_html/app.py'.
[Tue May 22 06:49:45.763872 2018] [:error] [pid 24298] [client 46.103.59.37:14500] Traceback (most recent call last):
[Tue May 22 06:49:45.763911 2018] [:error] [pid 24298] [client 46.103.59.37:14500]   File "/home/nikos/public_html/app.py", line 4, in <module>
[Tue May 22 06:49:45.763951 2018] [:error] [pid 24298] [client 46.103.59.37:14500]     import re, os, sys, socket, time, datetime, locale, codecs, random, smtplib, subprocess, geoip2.database, bottle_pymysql
[Tue May 22 06:49:45.763976 2018] [:error] [pid 24298] [client 46.103.59.37:14500] ImportError: No module named geoip2.database
===============================================================

He is the relative httpd-vhosts.conf

<VirtualHost superhost:*>
    ServerName superhost.gr

    WSGIDaemonProcess public_html user=nikos group=nikos processes=1 threads=5
    WSGIScriptAlias / /home/nikos/public_html/app.py

    ProxyPass / http://superhost.gr:5000/
    ProxyPassReverse / http://superhost:5000/


    <Directory /home/nikos/public_html>
        WSGIProcessGroup public_html
        WSGIApplicationGroup %{GLOBAL}
        WSGIScriptReloading On

        Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI

        AddHandler cgi-script .cgi .py
        AddHandler wsgi-script .wsgi .py

        AllowOverride None
        Require all granted
    </Directory>
</VirtualHost>


Any ideas as to why iam getting the above error although i have python36 isntalled along with all modules? why can it find it?



More information about the Python-list mailing list