[Python] pip install from Git repository fails with "does not appear to be a Python project"...

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

  1. Stack

    Stack Membro Participativo

    pip install Fails with "does not appear to be a Python project" When Installing from Git Repository with Subdirectory


    I'm attempting to install a Python package from a specific branch of a Git repository using the following command:

    pip install git+ssh://git@bitbucket.org/project/repository.git@branch-name#egg=package-name&subdirectory=subdirectory


    But I am encountering this error:

    ERROR: package-name from git+ssh://git@bitbucket.org/project/repository.git@branch-name#egg=package-name does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.


    What I have tried:

    Checked for pyproject.toml: The subdirectory contains the necessary Python files, and pyproject.toml is located in the root directory. To verify, I ran:

    cd package_directory && pip install -e .


    This worked successfully.

    Question: How can I correctly install this Python package from the Git repository when pip is not recognizing the pyproject.toml file?

    Here's my pyproject.toml file (I'm using UV as the project manager):

    [project]
    name = "name"
    version = "1.0.0"
    description = "description"
    authors = [{ name = "name", email = "email@gmail.com" }]
    requires-python = ">3.9,<4.0"
    dependencies = [
    "pydantic>=2.9.2,<3",
    "boto3>=1.35.54,<2",
    "structlog>=24.4.0,<25",
    "pymongo>=4.10.1,<5",
    "opentelemetry-sdk>=1.28.2,<2",
    "httpx>=0.27.0,<0.28",
    ]

    [dependency-groups]
    dev = [
    "mypy>=1.14.1",
    "pre-commit>=4.0.1",
    "pytest>=8.3.4",
    "respx>=0.22.0",
    "ruff>=0.9.2",
    ]

    Continue reading...

Compartilhe esta Página