uWSGI配置:
<uwsgi>
<module>app_wsgi:app</module>
<pythonpath>./src</pythonpath>
<socket>/tmp/uwsgi.sock</socket>
<pidfile>/tmp/uwsgi.pid</pidfile>
<daemonize>uwsgi.log</daemonize>
</uwsgi>
构建配置文件
[buildout]
parts = eggs uwsgi
versions = versions
include-site-packages = false
[eggs]
recipe: zc.recipe.egg:eggs
eggs =
flask
[versions]
flask = 0.9
[uwsgi]
recipe: buildout.recipe.uwsgi
version = 1.4.3
例外:
*** Operational MODE: single process ***
added ./src/ to pythonpath.
Traceback (most recent call last):
File "./src/app_wsgi.py", line 1, in <module>
from app import create_app
File "./src/app.py", line 1, in <module>
from flask import Flask, request
ImportError: No module named flask
unable to load app 0 (mountpoint='') (callable not found or import error)
如果出现以下情况,如何修复这个问题很清楚:虚拟环境,但使用 buildout 一切都变得更加复杂。手动更改 pythonpath 不是解决方案。有什么想法吗?