-
Notifications
You must be signed in to change notification settings - Fork 490
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
MSYS2 update fails due to broken setuptools in preexisting python #4813
Comments
Hi Markus,
Thanks but that didn't help. I tried with |
Your files seem to be from a different version of Python in the MINGW64 environment. Try |
Yes, that seem to have worked, but with a lot of scary warnings: # pacman --overwrite "/usr/lib/python3.12/*" -Suy
# <Waiting a very long time for completion of "checking available disk space">
# $ python -V && pip -V
Python 3.12.4
pip 24.1.2 from /usr/lib/python3.12/site-packages/pip (python 3.12)
# pip list --outdated
Package Version Latest Type
------- ------- ------ -----
pip 24.1.2 24.2 wheel and not able to update the pip package itself: # pip install -U pip
error: externally-managed-environment
... <see screenshot> Any idea what this means? |
This is very weird, the python in Opening MINGW64 shell and running: # python -V && pip -V
Python 3.11.9
pip 24.1.2 from C:/msys64/mingw64/lib/python3.11/site-packages/pip (python 3.11)
# pacman -Suy
:: Synchronizing package databases...
clangarm64 is up to date
mingw32 is up to date
mingw64 is up to date
ucrt64 is up to date
clang32 is up to date
clang64 is up to date
msys is up to date
:: Starting core system upgrade...
there is nothing to do
:: Starting full system upgrade...
there is nothing to do I was expecting pacman to update all MSYS related environments, or is that incorrect expectation? # pacman -Q | grep "python"
mingw-w64-ucrt-x86_64-python 3.11.9-1
mingw-w64-x86_64-python 3.11.9-1
mingw-w64-x86_64-python-distlib 0.3.8-2
mingw-w64-x86_64-python-pip 24.1.2-2
mingw-w64-x86_64-python-setuptools 70.2.0-2
python 3.12.4-6
python-pip 24.1.2-1 |
The fix is to disable pacman checking the disk space:: # Comment out "CheckSpace" in /etc/pacman.conf
cd /etc && cp pacman.conf pacman.conf.bak && sed -i 's/^CheckSpace/#CheckSpace/' pacman.conf |
You have the latest available version of Python afaict: |
Wait until it is packaged and distributed by MSYS2. |
The initial error is likely from using pip outside of a venv in the MINGW64 env, which you shouldn't do on any system. Never run pip outside of a venv, unless you can handle the breakage, or you manage your own Python installation. I know it's confusing, just keep that in mind :) We'll likely disallow this in the future, similar as with #4762 - but that will likely break various CI workflows depending on it (just a guess, no hard numbers there). |
Hi Christoph
(a) I don't understand this. So how should I run it? What is the venv that need to be created (or is it already created?) (b) Do I need to run the (c) How to get rid of the |
You have to create it. https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#create-and-use-virtual-environments If you want to mix the system packages with the venv you can either create a venv with "--system-site-packages", or install outside of a venv with "pip install --user", but this will interfere with the system Python, so can break things.
No, it updates everything.
I don't know, I don't have much winget experience. |
What is your definition of (a) This doesn't make any sense. There is no info/docs about having to manually create a venv for updating MSYS2 install. MSYS2 should not interfere by anything on PC/Windows system, by default. Anything else is very problematic and probably wrong behavior. (b) Well, that is not how it was working in my case above. (c) "I don't know, I don't have much winget experience." Ok, please don't get offended, but this is quite worrisome, as MSYS2 was made for cross compatibility (for *nix and Win) and for Windows usage. I much appreciate your help. It looks to me that updating MSYS2 with new Python version is broken and require a complete refresh install of MSYS2. This is highly inconvenient with the increased python update frequency. |
Given the above issues, if we have to wait until MSYS2 team can repackage new Python versions for all MSYS2 instances, you should probably not make any official releases that contain mixed python versions. (Here you mixed python |
You didn't show anywhere that having different versions of Python in the MSYS2 and in the MinGW environments causes the update mechanism to break. And I'm pretty sure that everything is working as expected currently. Like @lazka tried to explain to you multiple times, you installed packages with |
$ python -c "import site; print(site.getsitepackages())"
['/usr/lib/python3.12/site-packages'] |
I managed to pin the current installed version with: # winget list --upgrade-available
The following packages have an upgrade available, but require explicit targeting for upgrade:
Name Id Version Available Source
-------------------------------------------
MSYS2 MSYS2.MSYS2 20240507 20240727 winget
# winget pin add -q 'MSYS2.MSYS2'
Found MSYS2 Installer [MSYS2.MSYS2]
Pin added successfully
Well, I'm not going to argue with you for not looking at the screenshots. The very first one clearly show that there was a real issue with
So "pretty sure" means you have no idea. I wouldn't come here to waste my time if I didn't think my bug report was real. So no need to make outlandish accusations.
I have not installed anything since I first installed MSYS2, neither any python packages. The python And for the $ echo -e "$MSYSTEM" && python -V && pip -V && echo && pip list && echo && pip list --outdated
UCRT64
Python 3.11.9
pip 24.1.2 from /usr/lib/python3.12/site-packages/pip (python 3.12)
Package Version
------- -------
pip 24.1.2
Package Version Latest Type
------- ------- ------ -----
pip 24.1.2 24.2 wheel The other environments are consistent. Yes, I didn't know we need to use pacman provided packages for python packages. That doesn't make sense to me, so why is that? Which packages have to be pacman provided and which does not? |
That means you are missing the ucrt64 pip: |
Sorry I mixed up the versions, it should be the opposite:
|
Description / Steps to reproduce the issue
I got an MSYS update notification in winget:
So because of "explicit targeting message", I opened an MSYS shell and tried to run
pacman -Suy
, which then failed with:Screenshots:
Expected behavior
That MSYS/pacman correctly updates and installs python package,
and not blocking all other packages if one fails.
Actual behavior
MSYS pacman fails to install python and subsequently fails to update anything else.
Verification
Windows Version
MSYS_NT-10.0-22631
Are you willing to submit a PR?
no
The text was updated successfully, but these errors were encountered: