# ModuleNotFoundError: No module named 'agents'

**URL:** <https://community.openai.com/t/modulenotfounderror-no-module-named-agents/1141761>\
**Category:** API\
**Tags:** api\
**Created:** [March 12, 2025, 8:31pm UTC](https://community.openai.com/t/modulenotfounderror-no-module-named-agents/1141761 "2025-03-12T20:31:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![donniekerr01](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/donniekerr01/32/162004_2.png) [@donniekerr01](https://community.openai.com/u/donniekerr01)\
**Post date:** [March 12, 2025, 8:31pm UTC](https://community.openai.com/t/modulenotfounderror-no-module-named-agents/1141761/1 "2025-03-12T20:31:15Z")

</div>

I get this error ModuleNotFoundError: No module named ‘agents’  
when I attempt to import  
from agents import Agent, Runner  
openai-agents has been installed and listed in requirements.txt

---

<div class="post-metadata">

**Author:** ![jochenschultz](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/jochenschultz/32/772274_2.png) [@jochenschultz](https://community.openai.com/u/jochenschultz)\
**Post date:** [March 12, 2025, 11:29pm UTC](https://community.openai.com/t/modulenotfounderror-no-module-named-agents/1141761/2 "2025-03-12T23:29:48Z")

</div>

Which API are you calling? completion?

---

<div class="post-metadata">

**Author:** ![donniekerr01](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/donniekerr01/32/162004_2.png) [@donniekerr01](https://community.openai.com/u/donniekerr01)\
**Post date:** [March 13, 2025, 12:14am UTC](https://community.openai.com/t/modulenotfounderror-no-module-named-agents/1141761/3 "2025-03-13T00:14:06Z")

</div>

It is new agents SDK. But all of a sudden it started finding the module. Don’t know why. Maybe a refresh of the requirements.txt did the trick. Idk  
Thank you for responding

---

<div class="post-metadata">

**Author:** ![masahati.navid](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/masahati.navid/32/564022_2.png) [@masahati.navid](https://community.openai.com/u/masahati.navid)\
**Post date:** [March 13, 2025, 12:23am UTC](https://community.openai.com/t/modulenotfounderror-no-module-named-agents/1141761/4 "2025-03-13T00:23:01Z")

</div>

I’m getting the same err:  
python 3.12.8 - windows  
openai==1.66.3  
openai-agents==0.0.3

---

<div class="post-metadata">

**Author:** ![ssslomp](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/ssslomp/32/564504_2.png) [@ssslomp](https://community.openai.com/u/ssslomp)\
**Post date:** [March 13, 2025, 9:14pm UTC](https://community.openai.com/t/modulenotfounderror-no-module-named-agents/1141761/5 "2025-03-13T21:14:22Z")

</div>

Check the name or the directory that you’re using to define your project.

If you name it `agents.py` or `agents` you will precede the import from Python site-packages.

---

<div class="post-metadata">

**Author:** ![josejaimefelixgarcia](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/josejaimefelixgarcia/32/481219_2.png) [@josejaimefelixgarcia](https://community.openai.com/u/josejaimefelixgarcia)\
**Post date:** [September 6, 2025, 10:57am UTC](https://community.openai.com/t/modulenotfounderror-no-module-named-agents/1141761/6 "2025-09-06T10:57:41Z")

</div>

It’s also possible that you have an interpreter mismatch, which can happen if you’ve set up a virtual environment (venv)

1. Make sure that the venv is activated

`. .venv/bin/activate 2>/dev/null || source .venv/bin/activate`

1. Check the Python version inside the venv

`python -V # e.g. Python 3.12.10`

1. Deactivate the venv and check global Python  
`deactivate`
2. Compare the versions

- if they match, your interpreter is fine.
- if they differ, update your IDE setting:
  - In Cursor/VS Code:
    - Press ⌘⇧P
    - Scroll down and select “Python: Interpreter”
    - Choose the one pointing to your venv .venv/bin/python
