Connect your Python project to an Azure Artifacts feed

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

This article guides you through setting up your Python project and connecting to an Azure Artifacts feed.

Prerequisites

Product Requirements
Azure DevOps - An Azure DevOps organization.
- An Azure DevOps project.
- Download and install Python.

Install the credential manager

If this is your first time using Azure Artifacts on this machine, run the following command to install the Azure Artifacts keyring, required for authenticating with Azure Artifacts feeds:

pip install keyring artifacts-keyring

Project setup

Follow the steps below to set up your project and connect to your feed.

Make sure you have the latest version of pip python -m pip install --upgrade pip and if you're using Linux, ensure you've installed the prerequisites required for the credential manager.

  1. Sign in to your Azure DevOps organization, and navigate to your project.

  2. Select Artifacts, and then select your feed from the dropdown menu.

  3. Select Connect to feed, and then select pip from the left.

  4. Create a virtual environment if you don't have one already.

  5. Add a pip.ini (Windows) or pip.conf (Mac/Linux) file to your virtualenv and paste the provided snippet from the Project setup section into the file. Your config file should look similar to the following snippet:

    [global]
    index-url=https://pkgs.dev.azure.com/ORGANIZATION_NAME/PROJECT_NAME/_packaging/FEED_NAME/pypi/simple/
    

Note

You need pip version 19.2 or higher to use artifacts-keyring. For more information, see Usage requirements.

Next steps