#Help importing openai python

7 messages · Page 1 of 1 (latest)

scenic idol
#

I'm just starting out and right now with python and I can't get openai library installed or something. I've run pip install --upgrade openai already and that worked, but it returns an error at import openai at the top of my code. Why isn't this working?

gentle oyster
#

Hmmm looks weird, that’s the exact sample code

#

Can you show what your OpenAI package version is? Do pip show openai

#

and also, what version of python are you using?

untold cargo
#

I have a feeling it has something to do with your directories. The slashes change direction in the traceback.

I recommend to everyone to always use virtualenv with all of your projects. In this case, I bet it will fix the problem.

Another thought, why are you using --upgrade? Have you tried uninstalling and installing using pip install openai?

scenic idol
#

turns out it was that i was using a python version from like 2018 and every time i tried to install the newer version it didnt work (unknown to me)

#

anyways i fixed it, everythings working now :D