ModuleNotFoundError: No module named ‘openai.error‘

ModuleNotFoundError: No module named ‘openai.error’

result = self.fn(*self.args, **self.kwargs) File “H:\chatGPTWeb\chatgpt-on-wechat\channel\chat_channel.py”, line 168,
in _handle
reply = self._generate_reply(context) File “H:\chatGPTWeb\chatgpt-on-wechat\channel\chat_channel.py”, line 178,
in _generate_reply
e_context = PluginManager().emit_event( File “H:\chatGPTWeb\chatgpt-on-wechat\plugins\plugin_manager.py”, line 189,
in emit_event
instance.handlers[e_context.event](e_context, *args, **kwargs) File “H:\chatGPTWeb\chatgpt-on-wechat\plugins\role\role.py”, line 104,
in on_handle_context
bot = Bridge().get_bot(“chat”) File “H:\chatGPTWeb\chatgpt-on-wechat\bridge\bridge.py”, line 53, in
get_bot
self.bots[typename] = create_bot(self.btype[typename]) File “H:\chatGPTWeb\chatgpt-on-wechat\bot\bot_factory.py”, line 22, in
create_bot
from bot.chatgpt.chat_gpt_bot import ChatGPTBot File “H:\chatGPTWeb\chatgpt-on-wechat\bot\chatgpt\chat_gpt_bot.py”, line 6,
in
import openai.error ModuleNotFoundError: No module named ‘openai.error’

1、错误原因

Openai升级之后,openai.error 被去掉了。
参考解决方案:https://github.com/openai/openai-python/issues/840(访问前请注意上网环境)

2、修复方法

  1. Openai版本 退到0.28.0
  2. 把openai.error去掉,然后下面的异常放置到openai下访问。在这里插入图片描述在这里插入图片描述
  • 13
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

风吹落叶花飘荡

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值