Skip to content

Codex CLI running virtual environment in python faces NameResolutionError for request get. #6451

@kevinthmm

Description

@kevinthmm

What version of Codex is running?

codex-cli 0.56.0

What subscription do you have?

Plus

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

Codex CLI seems to hit this error when invoking the system's sh tool to run a project's venv python binary.

• Ran /bin/sh -lc '.venv/bin/python -m new_nautilus_trader_migration.main' └ Traceback (most recent call last): File "/Users/myusername/Downloads/myproject/.venv/lib/python3.10/site-packages/urllib3/connection.py", line 198, in _new_conn … +66 lines requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.massive.com', port=443): Max retries exceeded with url: /v2/aggs/ticker/APPL/range/1/ minute/2025-11-07/2025-11-10?adjusted=true&sort=asc&limit=50000 (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x11b134430>: Failed to resolve 'api.massive.com' ([Errno 8] nodename nor servname provided, or not known)"))

the python script runs fine when triggering from my IDE's run configuration (Pycharm), or terminal (zsh and sh). But when codex cli tries to test the script, the run always fails with the above error.

What steps can reproduce the bug?

  1. Create a python project
  2. Create a virtual env for that project
  3. install required modules in that virtual env such as requests
  4. Make a requests.get call to a endpoint
  5. Create an AGENTS.md file and instruct codex to never use python when running, but to use .venv/bin/python to ensure codex uses the right python binary.
  6. Above error is thrown in codex. (non-breaking), codex is unable to self-test and relies on user manual testing.

What is the expected behavior?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtool-callsIssues related to tool calling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions