openai-python icon indicating copy to clipboard operation
openai-python copied to clipboard

pip install openai==0.27.1 unable to install

Open crbellis opened this issue 2 years ago • 6 comments

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

crbellis avatar Mar 09 '23 18:03 crbellis

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

ar-mccabe avatar Mar 09 '23 22:03 ar-mccabe

Same problem here.

AlexGoiaDev avatar Mar 09 '23 23:03 AlexGoiaDev

Same problem. Affecting installation of llama-index and gpt-index.

Temporary solution: Reverted to 0.27.0

TonyIndia3000 avatar Mar 10 '23 09:03 TonyIndia3000

Try installing pip install aiohttp

KoenLeemans avatar Mar 10 '23 10:03 KoenLeemans

Same issue here in Google Colab. I am able to install aiohttp in Colab. Python: 3.9.16

sungkim11 avatar Mar 10 '23 17:03 sungkim11

Can you add version to openai?

sungkim11 avatar Mar 10 '23 17:03 sungkim11

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

hauntsaninja avatar Mar 10 '23 19:03 hauntsaninja

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.

luisrunge avatar Mar 11 '23 00:03 luisrunge

Seeing the same issue in Colab still. The recommended fix above worked for me.

!pip3 install openai==0.27.0

WebforMike avatar Mar 11 '23 02:03 WebforMike

v0.27.2 is out and passes @hauntsaninja 's replication. That should fix this issue

hallacy avatar Mar 11 '23 03:03 hallacy