[Python] Specifying local relative dependency in requirements.txt

Discussão em 'Python' iniciado por Stack, Novembro 29, 2025.

  1. Stack

    Stack Membro Participativo

    I'd like to import a local package with a relative path in Python 3.12. When I do so I get this error:

    ValueError: non-local file URIs are not supported on this platform: ...


    The local package is properly set up.

    Project structure:

    project/
    - component_a/
    - requirements.txt
    - main.py

    - utils/
    - pyproject.toml
    - models


    component_a/requirements.txt:

    models @ file://../utils


    Steps to reproduce:

    > cd project/component_a
    > python3.12 -m venv venv
    > source venv/bin/activate
    > python -m pip install -r requirements.txt

    ValueError: non-local file URIs are not supported on this platform: 'file://../utils'

    Continue reading...

Compartilhe esta Página