< mod_wsgi cannot import flask.
我没有将烧瓶安装在virtualenv
下。我可以使用python shell导入烧瓶。我编辑了virtualhost配置,以包含WSGIDaemonProcess HRApp user=USER group=GROUP python-path=/home/USER/.local/bin/python3.5/site-packages
无济于事。我想念什么?
Python 3.5.2 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import flask
>>> flask.__version__
'1.0.2'
>>>
Apache配置:
WSGIDaemonProcess HRApp user=USER group=GROUP python-path=/home/USER/.local/bin/python3.5/site-packages
WSGIScriptAlias / /path/to/file.wsgi
<Directory /var/www/appname>
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
AuthType Basic
AuthName "USER"
AuthUserFile "/passwords_file"
Require valid-user
</Directory>
答案 0 :(得分:0)
通过在Flask应用程序的根文件夹中安装virtualenv,然后使用WSGIPythonHome
将mod_wsgi指向python安装解决了该问题。