To be honest, I ran into different issues, running in anaconda, I couldn’t “see” openai, so I ran the pip install inside of anaconda, and had missing packages, and ran into access issues trying to install those packages…
Virtual environments get you a large way there, venv, or anaconda etc. With slightly more configuration, docker containers are also extremely powerful.
No need for an internet connection, you can just reset and move on, as you said; once you are successful, the entire container can be scalably deployed as well.
Besides, for data science work, using a cloud hosted virtual machine has an extra hassle of uploading the data sets and downloading the model to be deployed. The dataset I am currently woking on is a 12 GB txt file with over 300 million rows. It would be hard to upload it somewhere while I figure out how to slice and dice it for analysis.
Thanks for posting this, I had the same issue, and you led me to the (start of) the solution. I went to the Scripts folder and just had to add “Python” before “openai,” and it worked.
However, I’m still stuck at the point of adding the API key. I get an error of “[Errno 2] No such file or directory,” and nothing seems to make it work.
Any ideas?
Can you try passing the key directly “in the clear” rather than using the environment variable approach?
python openai --api-key sk-YOURKEYHERE --verbose
I assume that you are within the scripts folder. Set to verbose to see what comes up.
HTH.
You are almost there. The rest of the arguments are not optional. Once you supply them, the command would work.
For reference, anything in [ ] is optional, anything else in { } is not. You need to use one of the tools or api arguments and proceed from there.
python openai --api-key sk-SOMETHING api answers… and so on.
works and I tried with Anaconda3-2021.05-Windows-x86_64.exe.
Description
The OpenAI Python library provides convenient access to the OpenAI API from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses which makes it compatible with a wide range of versions of the OpenAI API.
This library additionally provides an openai command-line utility which makes it easy to interact with the API from your terminal. Run openai api -h for usage.