pip install openai==0.27.1 unable to install
Describe the bug
Unable to install openai using pip for latest version. Works fine with pip3 install openai==0.27.0
To Reproduce
pip3 install openai
Output:
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting openai
Using cached openai-0.27.1.tar.gz (57 kB)
Installing build dependencies ... done
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip. Getting requirements to build wheel ... error error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip. Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ Requirement already satisfied: python-dotenv in /usr/local/lib/python3.9/dist-packages (1.0.0)
pip3 install openai==0.27.0
Succesful
Code snippets
No response
OS
Linux
Python version
python 3.9.16
Library version
openai-python v0.27.1
Bumping this; seeing the same issue (notebook in a Colab environment, Python 3.9). I had to revert to 0.27.0 as well in order to install.
Edit: typo
Same problem here.
Same problem. Affecting installation of llama-index and gpt-index.
Temporary solution: Reverted to 0.27.0
Try installing pip install aiohttp
Same issue here in Google Colab. I am able to install aiohttp in Colab. Python: 3.9.16
Can you add version to openai?
Thanks everyone for reporting!
You can work around by running pip install aiohttp requests tqdm typing_extensions before attempting to install openai
The issue seems to be that we dynamically get the version for the package from https://github.com/openai/openai-python/blob/94428401b4f71596e4a1331102a6beee9d8f0bc4/setup.cfg#L3
But in order to import openai.version, the runtime dependencies of openai need to be build dependencies of openai.
We should fix by a) shipping wheels, b) maybe just hardcoding the version in setup.cfg.
Here's a repro:
λ rm -rf env
λ python3.9 -m venv env
λ env/bin/pip freeze --all
pip==21.2.4
setuptools==58.1.0
λ env/bin/pip install openai==0.27.1 --no-cache-dir --no-build-isolation
I haven't looked into why it works for me with build isolation. Edit: possibly due to different setuptools version
Same here: !pip install openai
Result:
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/ Collecting openai Using cached openai-0.27.1.tar.gz (57 kB) Installing build dependencies ... done error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip. Getting requirements to build wheel ... error error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Seeing the same issue in Colab still. The recommended fix above worked for me.
!pip3 install openai==0.27.0
v0.27.2 is out and passes @hauntsaninja 's replication. That should fix this issue