Connect pip to the trusted index

Configure the pip package manager to fetch Python dependencies from a trusted artifact index by updating the pip.conf file.

About this task

Configuring the pip package manager ensures that your development environment uses only verified, secure packages. You can connect directly to the trusted index without service account credentials.

Prerequisites

  • You have installed Python 3.12.x on your system.

Procedure

  1. Create a pip.conf file to define the trusted index URL globally or locally:
    [global]
    index-url = https://packages.redhat.com/trusted-libraries/python/
  2. Choose your configuration scope:
    • Project-specific: Place in venv/pip.conf to isolate settings to one application.
    • User-level: Place in ~/.config/pip/pip.conf for all your personal projects.
    • System-level: Place in /etc/pip.conf to enforce the index for all users on the machine.