Failed following quick start

Quickstart suggested code doesn’t seem to be working.

(venv) talk2me ➤ pip show openai                                                                                                                                 git:main*
Name: openai
Version: 1.3.9
Summary: The official Python library for the openai API
Home-page: 
Author: 
Author-email: OpenAI <support@openai.com>
License: 
Location: /Users/arturas/dev/talk2me/venv/lib/python3.11/site-packages
Requires: anyio, distro, httpx, pydantic, sniffio, tqdm, typing-extensions
Required-by: 

(venv) talk2me ➤ python3 --version                                                                                                                               git:main*
Python 3.11.6

any clues?

See at the top where you named your own file openai.py?

And then try to import openai?

Try a file name mytestchat.py

3 Likes

waw! thank you!
I haven’t noticed that it mixed the file with the lib.

Python has a cool feature that allows you to import files as modules, but it can also lead to situations like this where it tries to import the file itself while importing from a Python package.

1 Like