设为首页 加入收藏

TOP

Python引入模块报错:Import "openai" could not be resolvedPylancereportMissingImports
2023-07-25 21:25:02 】 浏览:47
Tags:Python Import " openai" could not resolvedPylancereportMissingImports
复制Openai的代码进行测试的时候,发生:Import "openai" could not be resolvedPylance reportMissingImports

 

 以为是安装问题,检查安装,发现没有这个模块:

 

直接进行安装:pip install openai;报错:

No matching distribution found for pandas>=1.2.3 (from openai)
You are using pip version 10.0.1, however version 23.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

 

所以,需要进行先升级:python -m pip install --upgrade pip

 

 大约1分钟后,安装完成:

 

 如此,引入openai语句下不再出现提示,即表示成功引入:

 

 再次输入 python -v后,再输入 import openai,查看模块是否存在及路径,发现已有,完成解决。

 

 

 

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Python 学习爬虫---更改目录位置.. 下一篇Python装饰器实例讲解(二)

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目