1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Pycharm: "Python Interpreter exited with non-zero exit code -1" when connecting to an...

Discussão em 'Python' iniciado por Stack, Setembro 16, 2025.

  1. Stack

    Stack Membro Participativo

    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 MacOS Sequoia 15.6.1 with Docker Desktop, 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.

    [​IMG]

    The container is running persistently and I am able to interact with it via a terminal:

    [​IMG]

    I am using Pycharm's Add Interpreter -> On Docker workflow: [​IMG]

    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:

    [​IMG]

    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.

    [​IMG]

    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.

    Continue reading...

Compartilhe esta Página