openai module not found -- Confusion on how to use pip and Idle vs Cmd Prompt

74 Views Asked by At

This is my first post but I've benefited greatly in the past from reading all of your questions and collective knowledge.

I'm having trouble figuring out which program/interpreter to use Pip with to install prerequisite libraries for an assignment in my Intro to Programming class. We're focusing on Python and Idle, but prior to this class I've used R and ArcGIS -- Whereas ArcGIS is what my default directory is set up to in the Python Command Prompt

The directions are very vague, it just gives some commands to install libraries, the commands have a black background, and they wont run in Idle... So I'm assuming they should be run in a console.

Turns out the Windows 11 Command Prompt wont run these commands, was saying : "

`(arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3> pip install - upgrade openai

Usage:
  pip install [options] <requirement specifier> [package-index-    options] ...
  pip install [options] -r <requirements file> [package-index-    options] ...
  pip install [options] [-e] <vcs project url> ...

pip install [options] [-e] ... pip install [options] <archive url/path> ...

no such option: -u "`

or:

" C:\Users\19208\Desktop\Fall '23\Intro to Programming\aaaaa a a>pip install --upgrade openai 'pip' is not recognized as an internal or external command, operable program or batch file. "

Soooo I'm trying to run them/ change the default directory in Python Command Prompt. I don't know what I did to get the commands to run before, but it looked like it worked, until I went to test a portion of my script and Idle said:

" Traceback (most recent call last): File "C:/Users/19208/Desktop/Fall '23/Intro to Programming/aaaaa a a/translator.py", line 1, in <module> from openai import Openai ModuleNotFoundError: No module named 'openai' "

So I'm assuming that I didn't install it the right directory?? it's very confusing, I thought I had succesfully changed the directory somehow, but I did get yellow errors when I thought I was successful saying something about ArcGIS Pro = Access Denied

I accidentally closed out of that, so I can't get the error message to reproduce unfortunately, unless perhaps theres some way I can look at the log, if it's stored after I close it out.

Sorry this is so long, but I always see people ask what they've tried and what the error message said, so I figured I'd include that info

Please help, this is so much more difficult than the actual assignment itself...

Thank you all!

1

There are 1 best solutions below

0
Terry Jan Reedy On

If you run py -m pip install -h in command prompt, you will see that install has a

 -U, --upgrade               Upgrade all specified packages to the newest
                              available version. The handling of dependencies
                              depends on the upgrade-strategy used.

but no -update option. Since you apparently do not have openai installed, you do not need and likely should not use --upgrade. If you only have 1 python binary installed, you can leave out py -m. I hope you installed the py laucher when you installed Python. If you installed from Windows store, that may not have been a choice.