I have been trying to installen the openai library into python, but I keep running into problems. I have already installed C++ libraries.
It seems to have problems specific with aio http, and I get the error below. I a running a Windows 11 laptop without admin restrictions.
Error
"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
The error you’re encountering is related to the build process of the aiohttp library, and it seems to involve compatibility issues with Python 3.12 and potential deprecation warnings.
aiohttp
Here are a few steps you can try to address the issue:
pip
setuptools
python -m pip install --upgrade pip setuptools
python -m pip install aiohttp==<latest_version>
Replace <latest_version> with the latest version available on the Python Package Index (PyPI).
<latest_version>
Upgrade to Python 3.12 Beta: If you are using a stable release of Python, consider trying the Python 3.12 beta version. Keep in mind that beta versions may have bugs, so use them in a test environment.
Check for Updates in the Library: Check the GitHub repository or official documentation for aiohttp to see if there are any updates or discussions related to compatibility with Python 3.12. There might be a newer version or a workaround mentioned.
Build Tools: Ensure that you have the necessary build tools installed on your system. For Windows, you can install the Microsoft Visual C++ Build Tools. If you already have them installed, try repairing or reinstalling them.
Install a Pre-built Wheel: Instead of building aiohttp from source, you can try installing a pre-built wheel. Run the following command:
python -m pip install aiohttp --no-build-isolation
The --no-build-isolation flag disables build isolation and might help in some cases.
--no-build-isolation
If none of these steps resolve the issue, you might want to check the aiohttp GitHub repository or forum for any reported issues or contact the maintainers for assistance.
Edit:
Latest version is released on November 18, 2023
pip install aiohttp==3.9.0
Two solutions for this:
Either use python 3.11
python 3.11
or
pip install aiohttp==3.9.0b0
installs their current beta release that supports python 3.12.x
then try openai installation
openai
Link to git :https://github.com/KillianLucas/open-interpreter/issues/581