Python引入模块报错:Import “openai” could not be resolvedPylancereportMissingImports

复制Openai的代码进行测试的时候,发生:Import "openai" could not be resolvedPylancereportMissingImports

Python引入模块报错:Import "openai" could not be resolvedPylancereportMissingImports

 

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

 Python引入模块报错:Import "openai" could not be resolvedPylancereportMissingImports

直接进行安装: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引入模块报错:Import "openai" could not be resolvedPylancereportMissingImports

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

Python引入模块报错:Import "openai" could not be resolvedPylancereportMissingImports

 

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

Python引入模块报错:Import "openai" could not be resolvedPylancereportMissingImports

 

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

Python引入模块报错:Import "openai" could not be resolvedPylancereportMissingImports

 

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

Python引入模块报错:Import "openai" could not be resolvedPylancereportMissingImports

 

 

 

本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:Python引入模块报错:Import “openai” could not be resolvedPylancereportMissingImports - Python技术站

(0)
上一篇 2023年3月31日 下午9:03
下一篇 2023年3月31日
合作推广
合作推广
分享本页
返回顶部