python对接chatGPT的API踩坑历程

如果python版本3.7.1以上,可以直接【目前测试官网3.9版本比较稳定!】

本人实测,正常运行

python3 -m pip install --upgrade pip

No matching distribution found for pandas>=1.2.3 (from openai==0.10.5)

python3 -m pip install --upgrade pip

AttributeError: module 'openai' has no attribute 'ChatCompletion'或者
AttributeError: module 'openai' has no attribute 'Model'
  1. 从https://pypi.org/project/openai/#files下载,上传到服务器, openai-0.27.0-py3-none-any.whl
  2. 然后在该路径下pip3 install openai-0.27.0-py3-none-any.whl

ERROR: Package 'openai' requires a different Python: 3.6.8 not in '>=3.7.1'

显示python版本需要更高等级

Linux 下安装Python3.8_linux安装python3.8_dongfs-821的博客-CSDN博客

(Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))

【改装python3.9】

你可能感兴趣的:(机器学习算法,python,openai,chatGPT)