Repository navigation
Stop mise from managing Python globally - #11435
Michallote wants to merge 8 commits into
Conversation
mise's global Python pin shims python/pip ahead of the distro-packaged Python for every shell, which conflicts with tools that expect the system Python. omarchy-install-dev-env python now only installs uv; a migration drops the global mise pin on machines that already set it, without touching any project-local mise Python.
|
Doesn't this force Arch python on everyone by default? We want mise to handle and manage python. Maybe a different fix is to scope AUR and other commands that break to only see the system distribution python? |
Hi @csfh , python IS forced on everyone by default, even if you don't install it yourself almost all linux distros ship python. Part of the OS itself use python, or it wouldn't be shipped at all by default. Overriding system python is a bad bad idea for many reasons. (the issues have discussions in length if you wanna take a look). The TLDR is, never override global python, always use virtual environments (.venv), and
We don't want Quoting myself from one of the issues:
Whenever you try to do modifications to base python through any package manager you get a big red sign telling you this is a bad idea or the package manager outright refuses. For instance: ~ ✗ uv pip install numpy --system
Using Python 3.14.7 environment at: /usr
error: The interpreter at /usr is externally managed, and indicates the following:
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.
hint: Virtual environments were not considered due to the `--system` flagHowever As I mentioned in the issues before, this not just breaks the AUR, but breaks several applications themselves. Including extensions for nautilus and gnome applications that rely on python. Python for a long time has recommended against managing and installing libraries globally. The recommended way-of-work is always, ALWAYS to use virtual environments for any app you are developing or bundling. Either via You can still use mise, but the end result is you should always make a virtual environment, for which |
|
I think this would require some rethinking of how we integrate mise stubs with Omarchy to make a clean UX for using virtual environments and Mise together. Any idea what direction you want here? |
|
I double-checked this, and @Michallote is right about the underlying failure mode. Arch’s own Python packaging guidelines invoke This explains why the behavior may not have caused the same problems elsewhere. Debian and Ubuntu generally install distro-provided Python programs with an absolute I think Omarchy should keep activating mise shims in the desktop environment—that is important for GUI coding agents and other graphical development tools to resolve project-local tool versions. The problematic part is specifically To be clear, I don't think this is a bug or anything that could be "fixed" with mise. Outside projects, the Python shim will still be resolved, but would fall through to Arch’s |
|
@dhh Ready for review. |
|
Hi @jdx , thank you for looking into it. I initially explored flags in However it still shadows python in an impactful way: ~ ❯ mise install python@latest
mise hint use multiple versions simultaneously with mise use python@3.12 python@3.11
mise hint installing precompiled python from astral-sh/python-build-standalone
if you experience issues with this python (e.g.: running poetry), switch to python-build by running mise settings python.compile=1
python@3.14.7 Python 3.14.7
mise WARN python installed but not activated — it is not in any config file.
To install and activate, run:
mise use python
~ ❯ which python
/home/michallote/.local/share/mise/shims/pythonAnd even if we install a single particular option for example ~ ❯ mise install python@3.12
python@3.12.14 Python 3.12.14
mise WARN python installed but not activated — it is not in any config file.
To install and activate, run:
mise use python
~ ❯ which python3.12
/home/michallote/.local/share/mise/shims/python3.12
~ ❯ python3.12
mise ERROR No version is set for shim: python3.12
Set a global default version with one of the following:
mise use -g python@3.12.14
mise ERROR Version: 2026.9.1 linux-x64 (2026-09-02)
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more informationCompare this with ~ ❯ uv python install python3.12
Installed Python 3.12.14 in 22ms
+ cpython-3.12.14-linux-x86_64-gnu (python3.12)
~ ❯ which python
/usr/bin/python
~ ❯ which python3.12
/home/michallote/.local/bin/python3.12
~ ❯ python3.12
Python 3.12.14 (main, Aug 14 2026, 15:34:45) [Clang 22.1.3 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> It never overshadows system python, and
This last comment I didn't quite understand, do you mean that projects with a |
|
a couple of things in the transcript aren't showing what they look like, and I think the install ≠ activateThese are three different operations in mise:
A shim isn't a symlink to an interpreter — it's a dispatcher. When you run Mapping to uv, which is closer than it looks:
Re-reading your two cases
The shim is on PATH and resolves to system python. So with the global pin removed, this case is already fine.
The reason a On the uv comparison
The install prefixes are also byte-identical — both mise and uv ship the same python-build-standalone build containing Your questions"projects with a "How do we expect agents in python projects to behave currently?" — with the global pin gone:
So removing the pin makes agent behavior match what a plain Arch user gets, which seems like the right default. Agreed on the PR — dropping the global pin is the correct fix, and keeping |
|
One more thing, since I think there's a legitimate issue buried in here that removing the global pin doesn't address. Inside a project that pins python, bare I think this is minor in practice. I searched through a bunch of packages and ~90% of packages use full shebangs, but it would be an issue for some. Also, the shims have perf overhead which we should avoid anyhow. So I'm going to add a setting that excludes specific shim names entirely — mise still manages python, it just never creates One tradeoff worth knowing: with None of this blocks the PR — dropping the global pin is still the right fix, we should enable the setting later once I add it to mise. |
|
Update: this shipped in mise v2026.9.10 as the # ~/.config/mise/config.toml
[settings.shims]
exclude = ["python", "python3", "pip", "pip3"]or With that set, mise still installs and manages python normally, but it never creates shims for those names, and any existing ones are removed on the next The tradeoff from my earlier comment stands: with Two caveats worth knowing for omarchy:
This still doesn't block the PR; dropping the global pin is the right fix on its own. This just makes project-local python pins safe on Arch too. AI-assisted — Tool: Claude Code; model: anthropic/claude-fable-5-1; version: unavailable. |
Co-authored-by: Carlos Eduardo Moreira dos Santos <cems@cemshost.com.br>
|
Thanks for the reviews. PR should be good to go. 🙏🙏🙏 |
|
Reviewed at e6966ca, on a worker built from the Omarchy ISO, against current The bug reproduces on What this PR does on the same machine:
Tests: For the maintainer to weigh, not a defect: the migration removes any global mise Python pin, including one a user set on purpose rather than through the Omarchy menu. Nothing tells the two apart, and either kind causes the breakage above. Second opinion: none. The configured reviewer (Codex Medium) was reachable, but omabot's daily review budget was used up, so this review is one model's (Claude Opus 5.5). Because of that the PR is labelled |
This is a valid point, it doesn't change the conclusion though: the global pin itself is the hazard. The goal of this PR is to remove that pin for unsuspecting users who installed python through the menu. However, the two can't be told apart, so deliberate pins come out with the rest. That's the trade-off, which in my opinion is worth it. With this PR I am prioritizing system stability (i.e. less surprises for unsuspecting users). Users who genuinely need a global pin can restore it.
|
|
@Michallote that's why I keep saying to set |
|
Ready from here. Dropping the global mise Python pin is the right Arch fix (jdx agrees). Optional follow-up once maintainers want it: set mise |
|
Another reproduction on Omarchy 4.0.4-1, this time with Calibre from
Launching
|
quattro now ships uv as a lazy mise default tool, so the Python install keeps quattro's mise uv step and only drops the global python@latest pin. The install guard keys on mise's uv install, since ~/.local/bin/uv no longer exists. Removal keeps quattro's body and guard: the curl-installed uv it removed is gone, and quattro deliberately leaves uv in place on removal. The manual no longer says Python setup installs Python. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test asserted the global python@latest pin this branch removes, the pin that makes python resolve to mise's interpreter ahead of Arch's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mise rm is mise unuse, which also prunes installs no remaining tracked config needs. A virtualenv built on the old global interpreter declares nothing to mise, so pruning would break it; the migration means to remove only the pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
[Medium impact] The PR appears safe to merge; no new actionable issue was established. SummaryPython setup now installs
The earlier request for migration tests is cleared because repository guidance explicitly prohibits those tests. Reviews (2) · Last reviewed commit: "Gate the Python pin migration with an if" · Reviewed by Greptile |
|
This had stopped merging into How the merge resolves it:
Verified at 468c30a, on a worker built from the Omarchy ISO, against
Reviewed by Claude Opus 5.5 and Codex Medium. Codex's first round found the pruning issue above. Its second round, at this head, found nothing open. It also agreed that the older migration timestamp is harmless, because Greptile asked for a shell test of the migration. I haven't added one. The migration was run against real mise on the worker, as above, and whether it needs a mocked test as well is the maintainer's call. Still the maintainer's to weigh: the migration removes any global mise Python pin, including one a user set on purpose. jdx's |
|
I don't think that pr will affect python. Really I think the best fix would be for the arch packages to not use the python version on PATH but as long as that is the case the fix should be to stop using python via mise. I still don't think it's a good idea to remove the global pins. |
quattro folded test/shell.d/mise-python-dev-env-test.sh into the table-driven mise-dev-env-test.sh, so the branch's assertion that Python setup makes no python call to mise moves into that table, replacing quattro's check for the global python@latest pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AGENTS.md prefers a full conditional over an exit in one branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This stopped merging into What changed in the branch:
Verified at ad1d4a5, on a worker built from the Omarchy ISO, against
Reviewed by Claude Opus 5.5, Codex Medium and muse-wonder (pi, thinking high). Neither second reviewer found a defect at this head. Both confirmed that One thing for @Michallote: the description's Fix section still describes the branch from before the
Could you update the description to match? Whoever reads it before merging will otherwise look for changes that aren't there. Still the maintainer's to weigh: the migration removes any global mise Python pin, including one a user set on purpose. |
|
@omarchybot Description updated.
An user setting a global pin on purpose still breaks things on Arch inadvertently, at the operating system level. Removing it in the migration avoids errors the user would later attribute to Omarchy. |
|
Thanks for updating the description, @Michallote. I checked it against the diff at ad1d4a5 and it matches: the installer, the Install → Python guard, the unchanged removal path and the The code hasn't changed since the worker verification in my last comment, and the 36 commits Reviewed by Claude Opus 5.5, Codex Medium and muse-wonder (pi, thinking high). Both second reviewers read the new description and your reply. Neither found a defect. They agreed that a global pin breaks things the same way whoever set it, because the shim on What's left is the maintainer's call: whether the migration should also remove a global pin a user set on purpose (your reasoning is above for them to weigh), and that Install → Python shows as disabled once uv is installed, the same way Node's row does once Node is installed. |
Closes
Problem
omarchy-install-dev-env pythonranmise use --global python@latest, which puts mise'spython/pipshims ahead of the distro-packaged Python in every shell. Anything that expects the system interpreter — AUR/yaybuilds in particular — breaks.Fix
omarchy-install-dev-env pythoninstalls onlyuv(through mise, as upstream does) and sets no global mise Python.~/.local/share/mise/installs/uv, the same way Node's keys oninstalls/node.omarchy-remove-dev-env pythonand its menu guard are unchanged: removal still uninstalls mise Python and keepsuv.--no-prune, so installed interpreters stay.The migration removes only the global pin, not the installed interpreters. Pruning them would delete versions a project's own
.mise.tomlstill pins to, which is a legitimate, non-conflicting use of mise. Dropping the pin with--no-pruneleaves project-local mise Python untouched.Fixes #9158