Isolate application dependencies

Create and activate a virtual environment to isolate project dependencies and prevent conflicts with system-wide packages.

About this task

Use a virtual environment to isolate dependencies. This ensures that your project dependencies do not conflict with system-wide libraries and to enforce local index settings.

Procedure

  1. Run the following command to create a virtual environment:
    python3.12 -m venv venv
  2. Run the following command to activate the virtual environment:
    source venv/bin/activate
  3. (Optional): Apply Local pip Configuration

    If you are using a project-specific configuration, copy the pip.conf file into the virtual environment:

    cp my-pip.conf venv/