Forum in maintenance, we will back soon 🙂
Connect Python With OpenAI API section question
I was testing the API connection and it returned an error. Line 1 was import openai. I did install using "pip install openai" Any ideas?
sh-5.1$ /bin/python /home/mcuser/Documents/python/chatgpt.py
[670 preload-host-spawn-strategy] Warning: waitpid override ignores groups
Traceback (most recent call last):
File "/home/mcuser/Documents/python/chatgpt.py", line 1, in <module>
import openai
ModuleNotFoundError: No module named 'openai'
[670 preload-host-spawn-strategy] Warning: waitpid override ignores groups
sh-5.1$ /bin/python /home/mcuser/Documents/python/chatgpt.py
[670 preload-host-spawn-strategy] Warning: waitpid override ignores groups
Traceback (most recent call last):
File "/home/mcuser/Documents/python/chatgpt.py", line 1, in <module>
import openai
ModuleNotFoundError: No module named 'openai'
[670 preload-host-spawn-strategy] Warning: waitpid override ignores groups
I thought I would try the same using my Windows machine (was using a Linux machine). When I try "pip install openai" is get an error:
PS C:\Users\13173\Documents\GitHub\pro104-repo> pip install openai
pip : The term 'pip' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the e program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ pip install openai
+ ~~~
+ CategoryInfo : ObjectNotFound: (pip:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
@admin Yes sir! I ended up choosing the repair option on python. Said it was repaired. Working now. Pretty strange...
@hursel-williams yeah you should add your payment details to use the API