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

Python PEP 668 #636

Open
0x6d6f7468 opened this issue Jan 9, 2024 · 4 comments
Open

Python PEP 668 #636

0x6d6f7468 opened this issue Jan 9, 2024 · 4 comments

Comments

@0x6d6f7468
Copy link
Collaborator

0x6d6f7468 commented Jan 9, 2024

OS Used - ALL Information (architecture, linux flavor, etc.)

OS: Parrot Security
Architecture: aarch64
Python version: 3.11.2

Pastebin link to error you are encountering

error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

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.

Expected behavior (vs. what you encountered)

Install Python packages

Any additional information

Starting in Python 3.11, PEP 668 will prevent pip from installing system packages if the wider environment is managed by the package manager. There seems to be a few possible solutions for this:

  1. Break system packages via either export PIP_BREAK_SYSTEM_PACKAGES=1 or --break-system-packages argument
  2. Install all packages with local package manager (making sure we have Selenium 4.9.1)
  3. Look into installing everything into a virtual environment

I'm playing with this in my current setup.sh work. My current solution has been to just break system packages because I do all of my work in a transient VM, but I'm uncomfortable with this being the de facto solution without other people weighing in first. I'll look into the other solutions in the meantime, as time allows.

@digininja
Copy link
Contributor

digininja commented Jan 9, 2024 via email

@0x6d6f7468
Copy link
Collaborator Author

Yes, that is my understanding. I'm hoping that we might be able to switch to that without too much hassle (or change in usage).

@digininja
Copy link
Contributor

digininja commented Jan 9, 2024 via email

@0x6d6f7468
Copy link
Collaborator Author

I believe Ubuntu is still on Python 3.10 at the time of writing.

If you end up remembering any more information about that ticket you mention, that'd be helpful. However, it seems pretty obvious that we're going to want to switch to venvs.

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