在Apache 24中部署python flask应用程序 [英] deploying python flask application in apache 24

查看:75
本文介绍了在Apache 24中部署python flask应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了python(python 3.6 32位)flask应用程序,我需要将其部署在具有apache24 32bit的Windows服务器中.

I have developed a python (python 3.6 32bit) flask application and I need this to be deployed in a windows server with apache24 32bit.

我在中引用了步骤https://medium.com/@madumalt/flask-app-deployment-in-windows-apache-server-mod-wsgi-82e1cfeeb2ed

当我尝试在apache24中启动httpd.exe时,出现以下错误

When I try to launch the httpd.exe in apache24 am getting the below error

[Sun Jun 21 20:36:15.112840 2020] [mpm_winnt:notice] [pid 20600:tid 476] AH00455: Apache/2.4.43 (Win32) mod_wsgi/4.7.1 Python/3.6 configured -- resuming normal operations
[Sun Jun 21 20:36:15.112840 2020] [mpm_winnt:notice] [pid 20600:tid 476] AH00456: Apache Lounge VS16 Server built: Apr 21 2020 16:02:41
[Sun Jun 21 20:36:15.112840 2020] [core:notice] [pid 20600:tid 476] AH00094: Command line: 'httpd.exe -d C:/Apache24'
[Sun Jun 21 20:36:15.123841 2020] [mpm_winnt:notice] [pid 20600:tid 476] AH00418: Parent: Created child process 2064
Fatal Python error: Py_Initialize: unable to load the file system codec
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00002dfc (most recent call first):
[Sun Jun 21 20:36:21.808509 2020] [mpm_winnt:crit] [pid 20600:tid 476] AH00419: master_main: create child process failed. Exiting.

Please find the SET configurations below,
OS=Windows_NT
Path=C:\Python36-32\Scripts\;C:\Python36-32\;C:\Program Files\Common Files\Micro
soft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Micros
oft Shared\Microsoft Online Services;C:\ProgramData\Oracle\Java\javapath;C:\Wind
ows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowe
rShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\


PYTHONHOME=C:\Python36-32\
PYTHONPATH=C:\Python36-32\Scripts\

推荐答案

#1检查您是否安装了OLD python,并正确删除了它(包括旧环境vars,路径..)

#1 check if you have an OLD python installation and remove it properly (including old environment vars, path ..)

#2如果可能的话,我建议您将python安装升级到最后一个3.8.x +

#2 i would recommend you, if possible, upgrading your python installation to the last one 3.8.x +

#3您的问题很普遍:您的环境变量设置不正确:

#3 your problem is very common: your environment variables are NOT correctly set:

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆