Skip to content

Instantly share code, notes, and snippets.

@serrasqueiro
Created August 16, 2024 10:51
Show Gist options
  • Save serrasqueiro/e526fa8ccd4e65cea5d539758910a6c0 to your computer and use it in GitHub Desktop.
Save serrasqueiro/e526fa8ccd4e65cea5d539758910a6c0 to your computer and use it in GitHub Desktop.
Hints for Python

Installing Python packages

As a regular (non-root) Linux user, I wanted to install GitPython, which allows me to play with GIT using Python scripting. The command pip install GitPython yield the following error:

  • error: externally-managed-environment Then explaining...
If you wish to install a non-rpm packaged Python package,
    create a virtual environment using python3.11 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip

I wanted to be lazy, so I googled it, and came up with this page (from hackernoon):

  1. (here) hints

One of the hacked solutions to quickly superseed the jungle of virtual environment was this command:

  • pip install GitPython --break-system-packages

It basically worked: it installed GitPython under ~/.local/, example,

  • juicebox dir -a -z M -v .local/
    • 2024-08-16 10:29:13. .local/lib/python3.11/site-packages/GitPython-3.1.43.dist-info/INSTALLER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment