网页 综合 更新时间 2026-11-13 16:48:59

Xonsh Installation Guide - Xonsh 0.25.0 Documentation - Python-powered shell for Linux, macOS, Windows, Android. Alternative to PowerShell, cmd, Fish, Nushell, Zsh, Bash

自动蜘蛛 xon.sh 正文约 5083 字
Xonsh Installation Guide - Xonsh 0.25.0 Documentation - Python-powered shell for Linux, macOS, Windows, Android. Alternative to PowerShell, cmd, Fish, Nushell, Zsh, Bash
The guide is new so in case of error please open the issue in the tracker.
Xonsh is a full-featured shell and can technically be used as a login shell, but since it is not a POSIX‑compatible shell, we don’t recommend doing so unless you clearly understand the purpose and consequences. Do not attempt to set it as your default shell using chsh or by any other method that would replace the system shell.
The recommended practice is to create a Xonsh profile in your terminal emulator.
Xonsh is a Python-based shell that requires Python to be packaged, preinstalled or compiled in order to run. Since there are many ways to install Python, there are also many ways to run xonsh. The table describes the main approaches and their advantages.
Work in progress: binary build, running in RustPython, xonsh Flatpak. Check out Nightly build page.
When xonsh is used as a core shell, it is necessary to keep the Python environment with xonsh stable, predictable, and independent of system changes. Lightweight environment managers such as venv, pipx, or rye do not fully address this requirement. Package managers that can install fully isolated Python environments as a core feature, such as Miniconda or Micromamba, should be used.
Install Xonsh independently using Micromamba:
Learn more: Mamba installer.
The installation instructions for Windows were recently updated. If you run into any issues, please report them to the issue tracker.
We provide an experimental Xonsh installer for Windows (no admin rights required). Download the .exe from the Xonsh WinGet releases page:
inno6 — for Windows 10/11 (latest Python 3).
inno5 — for Windows 8.1+ (pinned to Python 3.13).
Or install via the script (no admin rights required):
You can install the xonsh package from PyPI with any pip-compatible installer (pip, pipx, uv, rye, poetry, etc.).
Pip can also install the most recent xonsh source code from the xonsh project repository:
Xonsh is available as a single AppImage bundled with Python, allowing you to run it on Linux without installation:
Study how to package your libraries in Xonsh AppImage article.
Xonsh publishes a handful of containers, primarily targeting CI and automation use cases. All of them are published on Docker Hub.
Example of running an interactive xonsh session in a container:
Learn more: Containers.
On Android, install xonsh inside Termux:
Also works inside UserLAnd, proot-distro, Linux Deploy, and similar Android-userland sandboxes. See Cross-platform for the Android-specific section, including ON_ANDROID / ON_TERMUX flags and known sandbox limitations.
Various operating system distributions provide platform-specific package managers that may offer a xonsh package. This approach is not recommended for the following reasons:
On non-rolling-release operating systems, the xonsh version is often outdated.
The package may be missing important dependencies.
System package managers install xonsh into the system Python environment, which means that any significant system update or change has a high probability of breaking the shell.
Using Nuitka (a Python compiler), it is possible to build a binary version of xonsh. Learn more in xonsh/2895.
Using RustPython (a Python Interpreter written in Rust), it is possible to run xonsh using Rust. Learn more in xonsh/5082.
How you update xonsh depends on the install method.
xonsh installed via pip
If xonsh was installed via pip (possibly into a virtual environment), you can update it from within xonsh itself using xpip — a predefined alias pointing to the pip command associated with the Python executable that runs the current xonsh session:
On Windows the running xonsh.exe is locked by the OS, so pip cannot replace it from inside xonsh itself. Grab the interpreter path with xcontext, leave the shell, then run pip from another terminal (cmd, PowerShell, etc.):
xonsh installed via a package manager
If you installed xonsh via a package manager, it is recommended to update it through the package manager’s appropriate command. For example, on macOS with homebrew:
Setting xonsh as your default login shell is not recommended. Xonsh is a full-featured shell and can technically be used as a login shell, but since it is not POSIX-compatible, system scripts and tooling that expect a POSIX shell may misbehave. Use it only if you clearly understand the purpose and consequences — see the rationale in Before Installing above. The recommended practice is to create a xonsh profile in your terminal emulator instead.
If you still want to use xonsh as your default shell, you will have to add xonsh to /etc/shells and switch:
You will have to log out and log back in before the changes take effect.
The xonsh/actions repository provides a composite action that installs xonsh on a GitHub Actions runner, so subsequent steps can run xonsh code natively. Tested on ubuntu-latest, macos-latest, and windows-latest.
Declare defaults.run.shell: xonsh {0} once for the whole job and every run: block in that job executes as xonsh:
Or set shell: xonsh {0} on individual steps when only some should run as xonsh:
访问原文 返回搜索 https://xon.sh/install.html
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。