uWSGI build flask应用程序错误如何解决

时间:2018-08-22 09:48:22

标签: python python-3.x uwsgi

用uwsgi启动flask应用程序时出错

ModuleNotFoundError: No module named '_ssl'

直接在python3中

Import ssl

不会报告任何错误。

错误消息

    *** Operational MODE: preforking+threaded ***
Traceback (most recent call last):
  File "text.py", line 2, in <module>
    From flask_restful import Api,Resource,reqparse
  File "/usr/local/python3/lib/python3.6/site-packages/flask_restful/__init__.py", line 5, in <module>
    From flask import request, url_for, current_app
  File "/usr/local/python3/lib/python3.6/site-packages/flask/__init__.py", line 21, in <module>
    From .app import Flask, Request, Response
  File "/usr/local/python3/lib/python3.6/site-packages/flask/app.py", line 25, in <module>
    From . import cli, json
  File "/usr/local/python3/lib/python3.6/site-packages/flask/cli.py", line 18, in <module>
    Import ssl
  File "/usr/local/python3/lib/python3.6/ssl.py", line 101, in <module>
    Import _ssl # if we can't import it, let the error propagate
ModuleNotFoundError: No module named '_ssl'
Unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***

Uwsgi配置信息

[uwsgi]
# uwsgi Address and port used at startup
Socket = 127.0.0.1:8001
# pointing to the website directory
Chdir = /root/wx_xiaochengxu/
# python Launcher file
Wsgi-file = wx_api1.py
# python application variable name to be started in the program
Callable = app
#processor number
Processes = 4
# Threads
Threads = 2
#Status detection address
Stats = 127.0.0.1:9191

0 个答案:

没有答案