Python ModuleNotFoundError:没有名为';gevent.wsgi';

Python ModuleNotFoundError:没有名为';gevent.wsgi';,python,python-3.6,wsgi,gevent,rasa-core,Python,Python 3.6,Wsgi,Gevent,Rasa Core,我在运行flask应用程序时遇到以下错误: 从gevent.wsgi导入WSGIServer ModuleNotFoundError:没有名为“gevent.wsgi”的模块 gevent已安装,满足要求 Pip版本为10.11和Python 3.6。 操作系统:Windows 10 x64 使用Anaconda虚拟机 同样的代码在另一台机器上工作,所以在某个地方我缺少配置,但我无法跟踪/找到它 from __future__ import absolute_import from __futu

我在运行
flask
应用程序时遇到以下错误:

从gevent.wsgi导入WSGIServer
ModuleNotFoundError:没有名为“gevent.wsgi”的模块

gevent已安装,满足要求

Pip版本为10.11和Python 3.6。
操作系统:Windows 10 x64
使用Anaconda虚拟机

同样的代码在另一台机器上工作,所以在某个地方我缺少配置,但我无法跟踪/找到它

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import logging
import json
from pprint import pprint
from rasa_core.channels import HttpInputChannel
from rasa_core import utils
from rasa_core.agent import Agent
from rasa_core.interpreter import RasaNLUInterpreter
from rasa_core.channels.channel import UserMessage
from rasa_core.channels.direct import CollectingOutputChannel
from rasa_core.channels.rest import HttpInputComponent
from flask import Blueprint, request, jsonify, abort    
def run(serve_forever=True):
#path to your NLU model
interpreter = RasaNLUInterpreter("models/nlu/default/current")
# path to your dialogues models
agent = Agent.load("models/dialogue", interpreter=interpreter)
#http api endpoint for responses
input_channel = SimpleWebBot()
if serve_forever:
    agent.handle_channel(HttpInputChannel(5004, "/chat", input_channel))
return agent
if __name__ == '__main__':
   utils.configure_colored_logging(loglevel="INFO")
   run()
尝试使用:

from gevent.pywsgi import WSGIServer
而不是:

from gevent.wsgi import WSGIServer

您引用的进口声明需要更新为:

from gevent.pywsgi import WSGIServer
gevent.wsgi模块在gevent 1.3发布时已被弃用。它的替代品是gevent.pywsgi模块,它已经存在了一段时间


在您的例子中,您使用的rasa核心库是具有错误导入行的库。这是从0.9.0版本开始的,因此您应该将该依赖项更新到较新的版本。

上述观点是正确的,但其rasa核心库存在问题。升级到0.9版本后。问题得到解决。