gpt4 book ai didi

python - 模块未找到错误 : No module named 'gevent.wsgi'

转载 作者:太空狗 更新时间:2023-10-29 18:19:46 26 4
gpt4 key购买 nike

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

from gevent.wsgi import WSGIServer
ModuleNotFoundError: No module named '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

关于python - 模块未找到错误 : No module named 'gevent.wsgi' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50461657/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com