Skip to content

Build fails due to externally-managed-environment #7

Description

@richard-hajek

Hey,

On newer pip it appears impossible to install pip-requirements.txt properly, my log:

➜  xxh +I xxh-plugin-prerun-dotfiles
Install xxh-plugin-prerun-dotfiles to local /home/meowxiik/.xxh/.xxh/plugins/xxh-plugin-prerun-dotfiles
Git clone https://github.com/xxh/xxh-plugin-prerun-dotfiles
Build xxh-plugin-prerun-dotfiles
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
    python-xyz', where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Arch-packaged Python package,
    create a virtual environment using 'python -m venv path/to/venv'.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.
    
    If you wish to install a non-Arch packaged Python application,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. Make sure you have python-pipx
    installed via pacman.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Installed /home/USER/.xxh/.xxh/plugins/xxh-plugin-prerun-dotfiles

Environment:

➜  ~ python --version
Python 3.11.6
➜  ~ pip --version
pip 23.3.1 from /usr/lib/python3.11/site-packages/pip (python 3.11)
➜  ~ pyenv versions
* system (set by /home/meowxiik/.pyenv/version)
  3.6.15
  3.7.17
  3.8.16
  3.10.10

Inherent decision of pip

This appears to be an inherent shift in priorities, basically saying "no pip packages shall be installed to user environment". One is supposed to create a virtual environment for this.

XXH

It appears that XXH creates a hermetic envirnment in PYTHONUSERBASE=$build_dir/home/.local. However this method makes pip think it's still installing into an externally managed pip environment. Given that it is not the case, perhaps just "--break-system-packages" would suffice

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions