原因

openai库版本过旧

解决办法(二选一)

  1. pip install -U openai
  2. 下载安装包放入你的项目根目录下,

    改名格式zip为whl(即:openai-0.27.0-py3-none-any.zipopenai-0.27.0-py3-none-any.whl

    终端执行pip install openai-0.27.0-py3-none-any.whl

目的就是更新你的openai,选择其中一种办法即可。

AttributeError: module 'openai' has no attribute 'ChatCompletion'的解决办法的更多相关文章

  1. 对于AttributeError: 'Flask' object has no attribute 'cli'的解决办法

    版权声明:本文为博主原创文章,未经博主允许不得转载. 环境flask-script2.0.5.flask0.10.1 运行官方文档sample 出现问题 c:\kk\flask\examples\fl ...

  2. 【Python 脚本报错】AttributeError: 'module 'yyy' has no attribute 'xxx'的解决方法

    先参考这篇记录大概理解了原因, 再深入了解下python的import机制, 发现自己的模块之间存在互相import. 比如,A.py中import B,而B.py中也import A了, 现在执行模 ...

  3. AttributeError: 'module' object has no attribute 'X509_up_ref'

    主要报错: AttributeError: 'module' object has no attribute 'X509_up_ref' 1 解决办法 卸载再重装pyOpenSSL pip unins ...

  4. python出现AttributeError: module ‘xxx’ has no attribute ‘xxx’错误时,两个解决办法

    运行python程序时,也许会出现这样的错误:AttributeError: module ‘xxx’ has no attribute ‘xxx’: 解决该错误有两种方法 1.手动安装该模块 2.检 ...

  5. python中引入包的时候报错AttributeError: module 'sys' has no attribute 'setdefaultencoding'解决方法?

    python中引入包的时候报错:import unittestimport smtplibimport timeimport osimport sysimp.reload(sys)sys.setdef ...

  6. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  7. attributeError:'module' object has no attribute ** 解决办法

    写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...

  8. AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'

    /*************************************************************************** * AttributeError: 'modu ...

  9. AttributeError: 'module' object has no attribute 'Thread'

    $ python thread.py starting at: 2015-08-05 00:24:24Traceback (most recent call last):  File "th ...

  10. AttributeError: module 'enum' has no attribute 'IntFlag'

    Mac PyCharm新建以Python3.6.1为解释器的Django项目的时候出现以下错误提示: AttributeError: module 'enum' has no attribute 'I ...

随机推荐

  1. [OpenCV实战]9 使用OpenCV寻找平面图形的质心

    目录 1 名词解释 2 在OpenCV中查找Blob质心的步骤 3 图像多个blob下的质心获取 4 参考 在中学,我们学习了几何的中各种平面图形.找到标准平面图形的中心(几何中心)比较容易,如圆形, ...

  2. .gitignore文件配置以及gitee提交报Push rejected...错误解决

    .gitignore文件配置 .gitignore 文件可以用来忽略被指定的文件或文件夹的改动.记录在.gitignore文件里的文件或文件夹是不会被 git 跟踪到,也就是被忽略的文件是不会被上传到 ...

  3. 如何在 Nuxt 3 中使用 wavesurfer.js

    安装 wavesurfer.js 在项目中安装 wavesurfer.js npm install --save wavesurfer.js 常规方式引入 如果你的根目录中没有 components ...

  4. (18)go-micro微服务ELK介绍

    目录 一 什么是ELK 二 Beats的六种工具 三 ELK系统的特点 四 ELK+beats系统架构 五 ELK优点 六 最后 一 什么是ELK ELK是三个[开源软件]的缩写,分别表示:Elast ...

  5. vue3+quasar+capacitor开发多平台项目,使用cordova和capacitor插件(支持所有前端框架)

    先看文档 框架文档地址:https://quasar.dev/start/quasar-cli 创建项目 npm init quasar 运行与打包命令 npx quasar dev npx quas ...

  6. Mac下vscode编辑器设置

    设置成中文 command + shift + p  搜索 configure langure    , 点击一下 ,然后选择ZH 设置其他东西 打开配置文件:vscode菜单: Code -> ...

  7. @ControllerAdvice解密请求,加密响应

    package com.xf.config; import java.io.IOException; import java.io.InputStream; import java.lang.refl ...

  8. Maven配置 阿里云镜像地址

    <?xml version="1.0" encoding="UTF-8"?> <settings> <mirrors> &l ...

  9. 无法从“System.ReadOnlyMemory<byte>”转换为“byte[]”

    1.问题复现 RabbitMQ的官方示例:RabbitMQ消费端(接收端)获取消息时抛出异常,具体代码如下 var consumer = new EventingBasicConsumer(chann ...

  10. 微软出品自动化神器【Playwright+Java】系列(九)多线程、重定向、弹出新窗口、截图、新页面、录制、页面对象模式操作

    写在前面 关于Playwright系列的文章,真的很久没有写了,今天一个不小心官方API部分过完了,下面将为大家逐一演示,感兴趣的同学可以自行动手练习. API部分 多线程 直白点说就是多线程下Pla ...