Python Forum
ModuleNotFoundError: No module named 'openai'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ModuleNotFoundError: No module named 'openai'
#4
Look ok,follow this.
# Make 
C:\code>python -m venv openapi_env

# Cd in
C:\code>cd openapi_env

# Activate
C:\code\openapi_env>C:\code\openapi_env\Scripts\activate

# Install
(openapi_env) C:\code\openapi_env>pip install openapi
Collecting openapi
.....
Problem some guy has make this openapi same name stupid🔨
So it install this wrong version.

Do this install from Github directly.
(openapi_env) C:\code\openapi_env>pip install git+https://github.com/openai/open
ai-python.git
 ....
Successfully built openai
Installing collected packages: sniffio, pydantic-core, jiter, idna, h11, distro,
 colorama, certifi, annotated-types, tqdm, pydantic, httpcore, anyio, httpx, ope
nai
Successfully installed annotated-types-0.7.0 anyio-4.9.0 certifi-2025.1.31 color
ama-0.4.6 distro-1.9.0 h11-0.14.0 httpcore-1.0.7 httpx-0.28.1 idna-3.10 jiter-0.
9.0 openai-1.66.5 pydantic-2.10.6 pydantic-core-2.27.2 sniffio-1.3.1 tqdm-4.67.1

# Test that it works 
(openapi_env) C:\code\openapi_env>python
Python 3.12.2 (tags/v3.12.2:6abddd9, Feb  6 2024, 21:26:36) [MSC v.1937 64 bit (
AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from openai import OpenAI
>>>
For editor eg VS Code,i start from folder like this(code .) then it find virtual environment.
(openapi_env) C:\code\openapi_env>code .
Reply


Messages In This Thread
RE: ModuleNotFoundError: No module named 'openai' - by snippsat - Mar-19-2025, 09:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  No module named theapp Clives 10 9,809 Jun-10-2021, 11:16 AM
Last Post: Larz60+
  ModuleNotFoundError: No module named "requests" BushFacts 1 6,998 Jan-13-2020, 06:49 AM
Last Post: perfringo
  Django getting ModuleNotFoundError: No module named '=' Malt 0 3,713 Aug-30-2019, 08:34 AM
Last Post: Malt
  No module named flask_themes voipsense 4 6,060 Feb-25-2019, 06:54 PM
Last Post: voipsense
  About .profile and ImportError: No module named RicardoAbdala 1 3,930 Aug-28-2018, 05:32 AM
Last Post: buran
  ImportError: No module named django.core.exceptions in google app engine timtinan37 4 6,252 Jun-18-2018, 01:34 PM
Last Post: Larz60+
  ImportError: No module named '_sqlite3' armanmax11 5 23,297 Dec-16-2017, 02:13 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020