Skip to content

Instantly share code, notes, and snippets.

@Epivalent
Created July 11, 2024 19:44
Show Gist options
  • Save Epivalent/cf8e3b1c54a88d2677be61c534df9d82 to your computer and use it in GitHub Desktop.
Save Epivalent/cf8e3b1c54a88d2677be61c534df9d82 to your computer and use it in GitHub Desktop.

To make the Python environment not externally managed on Debian 12, you can follow these steps:

  1. Update your system's package list:

    sudo apt update
    
  2. Install pip3 (if not already installed):

    sudo apt install python3-pip
    
  3. Upgrade pip to the latest version:

    pip3 install --upgrade pip
    
  4. Remove any existing virtual environments (optional):

  5. Configure pip to install packages globally by creating a pip.conf file:

    a. Create the directory if it doesn't exist: mkdir -p ~/.config/pip/

    b. Create the pip.conf file using a text editor of your choice: nano ~/.config/pip/pip.conf

    c. Add the following content to the file and save it: [global] user = true

  6. Now you can directly use pip3 to install packages globally without worrying about virtual environments.

Please note that installing packages globally may affect system-wide Python dependencies and could potentially cause conflicts between different applications or versions of Python modules. It is generally recommended to use virtual environments for isolating project-specific dependencies whenever possible, as it helps maintain better control over package versions and avoids potential conflicts with other applications on your system.

Thu Jul 11 07:44:06 PM UTC 2024 - how do i make the python environment not externally managed on debian 12 so i can install packages using pip3 and not worry about virtual environments?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment