Problem importing installed module

18 views
Skip to first unread message

Ian W. Scott

unread,
Aug 19, 2019, 3:43:30 PM8/19/19
to web2py-users
When I try to import pytz at the top of my db.py model I'm getting the following error:

    No module named 'applications.paideia.modules.pytz'

"paideia" is the name of the application. I'm running python 3.7 and double-checked that pytz is accessible from the py3.7 interactive prompt. It is. So I don't understand why it's not being found.

This problem may be related to the fact that I'm using a brand-new apache/mod_wsgi setup. I don't know whether something in my apache configuration could be causing a problem. The welcome and admin apps work fine, though. It's only when I import a non-standard-library module.

But just in case, here's my server config:
(2.18.5-stable+timestamp.2019.04.08.04.22.03, Running on Apache/2.4.39 (Unix) mod_wsgi/4.6.7 Python/3.7, Python 3.7.4)

ServerRoot "/home/ianwscott/webapps/paideia/apache2"


#mime type for mpeg4 files 4 Addtype audio/mp4 .m4a


LoadModule authz_core_module modules/mod_authz_core.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule wsgi_module modules/mod_wsgi.so
LoadModule unixd_module modules/mod_unixd.so


LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/ianwscott/logs/user/access_paideia.log combined
ErrorLog /home/ianwscott/logs/user/error_paideia.log


DirectoryIndex index.py
DocumentRoot /home/ianwscott/webapps/paideia/htdocs
Listen 16797
KeepAlive Off
SetEnvIf X-Forwarded-SSL on HTTPS=1
ServerLimit 1
StartServers 1
MaxRequestWorkers 5
MinSpareThreads 1
MaxSpareThreads 3
ThreadsPerChild 5
WSGIDaemonProcess paideia processes=5 python-path=/home/ianwscott/webapps/paideia/lib/python3.7
WSGIProcessGroup paideia

WSGIRestrictEmbedded On
WSGILazyInitialization On


WSGIScriptAlias / /home/ianwscott/webapps/paideia/web2py/wsgihandler.py


<Directory /home/ianwscott/webapps/paideia/web2py>
 
AllowOverride None
 
Require all denied
 
<Files wsgihandler.py>
 
Require all granted
 
</Files>
</
Directory>


<Directory /home/ianwscott/webapps/paideia/web2py/applications/*/static/>
 Require all granted
</Directory>

<Location /admin>
 Require all denied
</Location>

<LocationMatch ^/([^/]+)/appadmin>
 Require all denied
</LocationMatch>


Reply all
Reply to author
Forward
0 new messages