[Python] How to use an index URL in pip install when both the package and index are stored in...

Discussão em 'Python' iniciado por Stack, Março 26, 2025.

  1. Stack

    Stack Membro Participativo

    I have stored both a Python package (mypackage.whl) and an index.html file (listing the package) in an Azure Storage Account (Blob Storage). I want to use pip install with --index-url to install the package directly from Azure Storage. However, pip does not recognize the Azure Storage URL as a valid package index.

    My Azure Storage container (mycontainer) contains: https://mystorageaccount.blob.core.windows.net/mycontainer/index.html https://mystorageaccount.blob.core.windows.net/mycontainer/mypackage-1.0.0-py3-none-any.whl

    I attempted to install the package using: pip install mypackage --index-url=https://mystorageaccount.blob.core.windows.net/mycontainer/

    But I got the error: ERROR: Could not find a version that satisfies the requirement mypackage (from versions: none)

    Questions:

    1. How can I configure the index.html file so that pip recognizes it as a valid package index?
    2. Are there alternative ways to host a pip-compatible package index in Azure Storage?

    Note that the storage container is public and I do not want to use Azure Artifacts—only Azure Blob Storage as Azure artifacts supports only package uploading.

    index.html looks like:

    [​IMG]

    When I click on package 1, it lists all whl files.

    [​IMG]

    Continue reading...

Compartilhe esta Página