Pycharm can't find python path for dockers interpreters

Trying to run and debug a Fastapi project under a docker-compose file.
Using a docker compose interpreter:

  • the first step works (docker is connected, docker-compose file is found, can select the service to run). 
  • The second step doesn't find anything (according to the docs, pycharm creates by itself a new target)
  • The third step is in infinite loading trying to find a python path

The same happens when trying to use the Docker interpreter (can create image, cannot find a python path environment)

I'm using python 3.11, and uv. The .venv is inside an app folder, not in root. Maybe because of that?
Because I've tried and example with .venv in the root folder and the python path was found.
 

EDIT: I'm also using the Pycharm Pro as a Trial, don't know if it's different

0
2 comments

Jose Ribeiro

Thanks for the report! It looks like something we’ll need to investigate further.
Please create YouTrack ticket  and provide a log archive (available via Help | Collect Logs and Diagnostic Data) along with detailed steps to reproduce the issue.

0

Since your .venv is tucked inside the /app folder rather than the root, PyCharm's automatic detection is likely tripping over the non-standard path. When using uv, the interpreter isn't typically located at the standard /usr/local/bin/python path found in basic images, and PyCharm’s "target discovery" often fails if it can't find a valid binary at the expected project root. To fix this, skip the automatic detection during the third step and manually set the Python interpreter path to the absolute path within your container (e.g., /app/.venv/bin/python). This should break the infinite loading cycle and allow the IDE to map your local code to the container's environment correctly Everfi.com

 

0

Please sign in to leave a comment.