[Python] Unable to install our Poetry plugin: pip says there is no matching distribution found

Discussão em 'Python' iniciado por Stack, Agosto 7, 2025.

  1. Stack

    Stack Membro Participativo

    I wrote a Poetry plugin and have it stored on a company PyPI repo. I am working on a Python project using Poetry and want to use my plugin. I though specifying the company repo with tool.poetry.source and then adding a line to

    [tool.poetry.requires-plugins]
    mycoolplugin = ">=1.0.3"


    would be enough to get Poetry to install the plugin but it did not work as I expected.

    I tried to install it manually and discovered there is a problem of some kind. I started with:

    pip install mycoolplugin -i https://artifactory.compay.com/artifactory/api/pypi/thw-pypi/simple
    Looking in indexes: https://artifactory.compay.com/artifactory/api/pypi/thw-pypi/simple
    Collecting mycoolplugin
    Downloading https://artifactory.compay.com/artifactory/api/pypi/thw-pypi/mycoolplugin/1.0.3/mycoolplugin-1.0.3-py3-none-any.whl (10 kB)
    INFO: pip is looking at multiple versions of mycoolplugin to determine which version is compatible with other requirements. This could take a while.
    Downloading https://artifactory.compay.com/artifactory/api/pypi/thw-pypi/mycoolplugin/1.0.2/mycoolplugin-1.0.2-py3-none-any.whl (10 kB)
    ERROR: Cannot install mycoolplugin==1.0.2 and mycoolplugin==1.0.3 because these package versions have conflicting dependencies.

    The conflict is caused by:
    mycoolplugin 1.0.3 depends on poetry==2.1.3
    mycoolplugin 1.0.2 depends on poetry==2.1.1

    To fix this you could try to:
    1. loosen the range of package versions you've specified
    2. remove package versions to allow pip to attempt to solve the dependency conflict

    ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts


    But I am running in a venv with Poetry 2.1.3 so why not choose the correct one? There is no ambiguity.

    poetry --version
    Poetry (version 2.1.3)


    So, I thought perhaps pip cannot tell what Poetry is already there so I ran it with Poetry instead, sadly this command line gives the exact same results:

    poetry run python3 -m pip install mycoolplugin -i https://artifactory.compay.com/artifactory/api/pypi/thw-pypi/simple`


    So, then I tried installing the specific version I wanted:

    poetry run python3 -m pip install mycoolplugin==1.0.3 -i https://artifactory.company.com/artifactory/api/pypi/thw-pypi/simple
    Looking in indexes: https://artifactory.company.com/artifactory/api/pypi/thw-pypi/simple
    Collecting mycoolplugin==1.0.3
    Using cached https://artifactory.company.com/artifactory/api/pypi/thw-pypi/mycoolplugin/1.0.3/mycoolplugin-1.0.3-py3-none-any.whl (10 kB)
    INFO: pip is looking at multiple versions of mycoolplugin to determine which version is compatible with other requirements. This could take a while.
    ERROR: Could not find a version that satisfies the requirement poetry==2.1.3 (from mycoolplugin) (from versions: none)
    ERROR: No matching distribution found for poetry==2.1.3


    What is wrong here?

    The mycoolplugin project has a pyproject.toml file with:

    [project]
    name = "mycoolplugin"
    ...
    dependencies = [ "poetry (==2.1.3)", ...
    ...
    [build-system]
    requires = ["poetry-core>=2.0"]

    Continue reading...

Compartilhe esta Página