I am trying to install the openai
module in python.
I first tried this:
pip install openai
from openai import OpenAI
it gave me this error :
Traceback (most recent call last):
File "C:UsersJohn Doemy_stuffpython_programsAI.py", 1, in <module>
pip install openai
^
SyntaxError: invalid syntax
and then I tried this:
from os import system
system('py -m pip install openai')
from openai import OpenAI
it gave me this error:
Traceback (most recent call last):
File "C:UsersJohn Doemy_stuffpython_programsAI.py", line 3, in <module>
from openai import OpenAI
ModuleNotFoundError: No module named 'openai'
I’m using python 3.10.5, it was the newest one I found.
New contributor
Lawson Luo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3