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下访问。
相关推荐
不剪发的Tony老师几秒前
Spyder:一款面向数据科学的Python集成开发环境
ide·python
众创岛43 分钟前
python中enumerate的用法
开发语言·python
布史43 分钟前
Prometheus Python Client 实操指南:从零实现自定义 Exporter
网络·python·prometheus
纤纡.1 小时前
矿物识别分类:8 种机器学习算法对比与实战(平均值填充数据集)
python·深度学习·算法·机器学习
2301_818419011 小时前
使用PyTorch构建你的第一个神经网络
jvm·数据库·python
代码探秘者1 小时前
【算法篇】3.位运算
java·数据结构·后端·python·算法·spring
`Jay1 小时前
Python Redis连接池&账号管理池
redis·分布式·爬虫·python·学习
2301_793804691 小时前
Python异步编程入门:Asyncio库的使用
jvm·数据库·python
2301_810160951 小时前
NumPy入门:高性能科学计算的基础
jvm·数据库·python
add45a1 小时前
超越Python:下一步该学什么编程语言?
jvm·数据库·python