Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails due to externally-managed-environment #7

Open
richard-hajek opened this issue Dec 8, 2023 · 1 comment
Open

Build fails due to externally-managed-environment #7

richard-hajek opened this issue Dec 8, 2023 · 1 comment

Comments

@richard-hajek
Copy link

richard-hajek commented Dec 8, 2023

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

@anki-code
Copy link
Member

PR with fix is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants