警告 C4996:“Py_OptimizeFlag”:在 3.12 aiohttp/_websocket.c(3042) 中已弃用:错误 C2039:“ob_digit”:不是“_longobject”的成员

warning C4996: 'Py_OptimizeFlag': deprecated in 3.12 aiohttp/_websocket.c(3042): error C2039: 'ob_digit': is not a member of '_longobject'

提问人:dzinee 提问时间:10/30/2023 最后编辑:Hugodzinee 更新时间:11/23/2023 访问量:1349

问:

新手在这里。

我一直在尝试将 openai 库安装到 python 中,但我一直遇到问题。我已经安装了 C++ 库。

它似乎有特定于 aio http 的问题,我收到以下错误。 我运行的是没有管理员限制的 Windows 11 笔记本电脑。

错误

"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\sande\AppData\Local\Programs\Python\Python312\include -IC:\Users\sande\AppData\Local\Programs\Python\Python312\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.37.32822\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" /Tcaiohttp/_websocket.c /Fobuild\temp.win-amd64-cpython-312\Release\aiohttp/_websocket.obj
      _websocket.c
      aiohttp/_websocket.c(1475): warning C4996: 'Py_OptimizeFlag': deprecated in 3.12
      aiohttp/_websocket.c(3042): error C2039: 'ob_digit': is not a member of '_longobject'

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

ERROR: Failed building wheel for aiohttp

Failed to build aiohttp

ERROR: Could not build wheels for aiohttp, which is required to install pyproject.toml-based projects
蟒蛇 python-3.x pip openai-api aiohttp

评论


答:

9赞 Goku - stands with Palestine 10/30/2023 #1

任一使用python 3.11

pip install aiohttp==3.9.0b0

安装支持 Python 3.12.x 的当前 beta 版本

然后尝试安装openai


链接到 git :https://github.com/KillianLucas/open-interpreter/issues/581