Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Flask应用程序部署-导入错误:没有名为“app”的模块_Python_Flask_Apache2_Mod Wsgi_Apache2.4 - Fatal编程技术网

Python Flask应用程序部署-导入错误:没有名为“app”的模块

Python Flask应用程序部署-导入错误:没有名为“app”的模块,python,flask,apache2,mod-wsgi,apache2.4,Python,Flask,Apache2,Mod Wsgi,Apache2.4,奇怪的是,我已经试了又试着让这个烧瓶应用程序运行起来,似乎有些地方出了问题 烧瓶应用程序中的$pwd提供: __init__.py __pycache__ vexxos.py windupflaskvexxos.wsgi /home/winduplordvexxos/winduplordvexxos.com/windupflaskvexxos 烧瓶应用程序中的$ls提供: __init__.py __pycache__ vexxos.py windupflaskvexxos.wsg

奇怪的是,我已经试了又试着让这个烧瓶应用程序运行起来,似乎有些地方出了问题

烧瓶应用程序中的$pwd提供:

__init__.py  __pycache__  vexxos.py  windupflaskvexxos.wsgi
/home/winduplordvexxos/winduplordvexxos.com/windupflaskvexxos

烧瓶应用程序中的$ls提供:

__init__.py  __pycache__  vexxos.py  windupflaskvexxos.wsgi
__init_uu;.py为空

vexxos.py:

windupflaskvexxos.wsgi:

然而,我在前端看到的是:

/etc/apache2/site available/000-default.conf:


我尝试了很多方法,除了模块导入等,但似乎没有任何效果……有人能帮忙吗?

您可能需要告诉mod_wsgi您的代码在哪里使用WSGIDaemonProcess的python路径选项。您在WSGI脚本文件中的导入看起来也是错误的

对于您可能需要的python路径:

python-path=/home/winduplordvexxos/winduplordvexxos.com
然后,导入应为:

from windupflaskvexxos import app as application
或者,如果应用程序不是由_init__u; py.py拉入的,请使用:

另外,请阅读使用mod_wsgi设置虚拟环境的首选方法。您使用的方式不是推荐的方式


天才这让它工作起来了——作为参考:我使用了一个组合,添加了python路径,我认为在这里使用flask pocco文档中的虚拟环境已经足够了,并且使用windupflaskvexxos.vexos导入应用程序作为应用程序。我想我失去它是因为主网站被用作Django应用程序。
[Fri Oct 13 23:05:14.650945 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859] mod_wsgi (pid=15561): Target WSGI script '/home/winduplordve$
[Fri Oct 13 23:05:14.651088 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859] mod_wsgi (pid=15561): Exception occurred processing WSGI scr$
[Fri Oct 13 23:05:14.657996 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859] Traceback (most recent call last):
[Fri Oct 13 23:05:14.658060 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859]   File "/home/winduplordvexxos/winduplordvexxos.com/windupfl$
[Fri Oct 13 23:05:14.658071 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859]     from .vexxos import app as application
[Fri Oct 13 23:05:14.658098 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859] SystemError: Parent module '' not loaded, cannot perform rel$
[Fri Oct 13 23:05:14.658131 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859]
[Fri Oct 13 23:05:14.658146 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859] During handling of the above exception, another exception oc$
[Fri Oct 13 23:05:14.658156 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859]
[Fri Oct 13 23:05:14.658180 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859] Traceback (most recent call last):
[Fri Oct 13 23:05:14.658229 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859]   File "/home/winduplordvexxos/winduplordvexxos.com/windupfl$
[Fri Oct 13 23:05:14.658248 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859]     from vexxos import app as application
[Fri Oct 13 23:05:14.658286 2017] [wsgi:error] [pid 15561:tid 140103054321408] [remote 109.149.163.9:59859] ImportError: No module named 'vexxos'
[Fri Oct 13 23:05:14.690252 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858] mod_wsgi (pid=15561): Target WSGI script '/home/winduplordve$
[Fri Oct 13 23:05:14.690318 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858] mod_wsgi (pid=15561): Exception occurred processing WSGI scr$
[Fri Oct 13 23:05:14.690468 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858] Traceback (most recent call last):
[Fri Oct 13 23:05:14.690515 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858]   File "/home/winduplordvexxos/winduplordvexxos.com/windupfl$
[Fri Oct 13 23:05:14.690525 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858]     from .vexxos import app as application
[Fri Oct 13 23:05:14.690549 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858] SystemError: Parent module '' not loaded, cannot perform rel$
[Fri Oct 13 23:05:14.690566 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858]
[Fri Oct 13 23:05:14.690573 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858] During handling of the above exception, another exception oc$
[Fri Oct 13 23:05:14.690577 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858]
[Fri Oct 13 23:05:14.690589 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858] Traceback (most recent call last):
[Fri Oct 13 23:05:14.690610 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858]   File "/home/winduplordvexxos/winduplordvexxos.com/windupfl$
[Fri Oct 13 23:05:14.690619 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858]     from vexxos import app as application
[Fri Oct 13 23:05:14.690637 2017] [wsgi:error] [pid 15561:tid 140103087892224] [remote 109.149.163.9:59858] ImportError: No module named 'vexxos'
python-path=/home/winduplordvexxos/winduplordvexxos.com
from windupflaskvexxos import app as application
from windupflaskvexxos.vexxos import app as application