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 - mark as externally managed #4762

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

lazka
Copy link
Member

@lazka lazka commented Jul 6, 2024

See https://peps.python.org/pep-0668/

Similar to what Arch does.

$ pip install pip
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-MSYS2-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.

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.

@lazka
Copy link
Member Author

lazka commented Jul 8, 2024

Let's see if anyone complains :)

@lazka lazka merged commit 338929a into msys2:master Jul 8, 2024
2 checks passed
@eabase
Copy link

eabase commented Aug 9, 2024

@lazka

I complain.

To install Python packages system-wide, try 'pacman -S ...`

What does this do, exactly?

System Wide for me means usable on windows PC from anywhere. basically same as installing python for Windows, and it doesn't seem appropriate behavior. MSYS2 should stay in it's box.

If you wish to install a non-MSYS2-packaged Python package,

This doesn't make any sense at all. Why should you have to install a python package as a separate MSYS2 package, in the first place. Python and pip was made to be portable, and by using MSYS2 specific installations, it seem to me you're breaking this concept.

So all python packages would be non-MSYS2-packaged, so why should they be placed in a venv, when it (IMO) would make more sense that MSYS-packaged pips should be kept in a venv container?

It's likely I could be wrong here, but at the end of the day, nobody should need to create a new venv when you try to upgrade your MSYS2 installation.

@lazka
Copy link
Member Author

lazka commented Aug 9, 2024

system wide in the context of Python means installing into system-site-packages, which is /usr/lib/python3.12/site-packages

@eabase
Copy link

eabase commented Aug 9, 2024

system-site-packages, which is /usr/lib/python3.12/site-packages

I'm on a Windows PC, so what is the path of that?
Because MSYS2 already has it's own path like that in:
C:\msys64\usr\lib\python3.12\site-packages

But now you're saying it is installed in:
C:\Python312\Lib\site-packages

^ THAT is for me the "system-site-packages".

@lazka
Copy link
Member Author

lazka commented Aug 9, 2024

To get a native Windows path that would be:

$ cygpath -m /usr/lib/python3.12/site-packages
C:/msys64/usr/lib/python3.12/site-packages

@eabase
Copy link

eabase commented Aug 9, 2024

Yes, but this is not exposed to my OS, so this path is not a (windows) "system-site-packages" path, only within the MSYS2 environment as exposed under C:/msys64/.

@jeremyd2019
Copy link
Member

Maybe the message could be improved somehow, perhaps "system-wide" is too wide on Windows, where there is no single system-wide python installation per se. I'm not sure what would be better, maybe something about "globally for this python installation" instead of "system-wide"?

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

Successfully merging this pull request may close these issues.

3 participants