I have a multi-container application managed by a docker-compose.yml file consisting of an ollama, openwebui, and python-dev. I'm working on PyCharm 2025.1.3.1; MacOS Sequoia 15.6.1; Docker 28.1.1, and the containers are running successfully via the docker compose up -d command. My goal is to configure PyCharm to use the Python Interpreter inside my existing, running python-dev container.
The container is running persistently and I am able to interact with it via a terminal:
I am using Pycharm's Add Interpreter -> On Docker workflow:

The introspection runs successfully showing where python exists on the container with a warning, but it finds the running environment so I'm not too concerned about this step:
However, when I click the "create" button on the final step, the process fails with the error: Python interpreter process exited with a non-zero exit code -1.
Since the introspection logs show success, I'm not sure what is failing at the final stage. The error is a generic exit code -1 too.
How can I successfully configure the interpreter to connect to my running python-dev service?
Docker Config Files
Further code is available on Github
Docker Compose:
version: '3.8'
services:
ollama:
image: ollama/ollama
container_name: ollama
volumes:
- ./ollama-data:/root/.ollama
ports:
- "11434:11434"
restart: unless-stopped
webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
volumes:
- ./webui-data:/app/backend/data
ports:
- "3000:8080"
environment:
- OLLAMA_BASE_URL=http://ollama:11434
depends_on:
- ollama
restart: unless-stopped
python-dev:
build: .
container_name: python-dev
volumes:
- ./:/app
ports:
- "8501:8501"
command: sleep infinity
# command: streamlit run src/app.py --server.runOnSave=true # also doesn't work
depends_on:
- ollama
restart: unless-stopped
Dockerfile:
FROM python:3.12-bullseye
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8501
Tried searching, using Google/LLMs, but no success thus far.




ports:, so you can reach them directly from the host system (probably usinglocalhostas a host name and the firstports:number). Can you use a non-container Python for day-to-day development, targeting these containerized services as needed for integration testing?