xonsh/docs/packages.rst

99 lines
3.9 KiB
ReStructuredText
Raw Normal View History

2020-10-09 01:54:42 +03:00
Package Manager
===============
2020-08-20 01:32:04 -04:00
2022-07-01 21:17:01 +05:30
You can install xonsh using ``conda``, ``pip`` or the package manager for
2020-08-20 01:32:04 -04:00
your operating system distribution.
For the fullest interactive user experience, these additional packages should also be installed:
:prompt-toolkit: for command completion, configurable key bindings and especially multi-line line editing.
2020-09-01 20:35:10 -04:00
:pygments: for xonsh and Python syntax-specific highlighting
2020-08-20 01:32:04 -04:00
:setproctitle: updates process title (in terminal window and process monitor) to match Xonsh arguments.
2022-07-01 21:17:01 +05:30
Installing with these packages is the recommended configuration and is documented first.
If you are operating in a specialized or restricted environment, you can install just the xonsh package, as
2020-08-20 01:32:04 -04:00
described in `fewer prerequisites`_
**conda:**
.. code-block:: console
$ conda config --add channels conda-forge
2020-09-01 20:35:10 -04:00
$ conda install xonsh
2020-08-20 01:32:04 -04:00
2022-07-01 21:17:01 +05:30
**pip:** Typically you will activate a virtual environment and install xonsh there. This will ensure that you invoke the
correct Python interpreter and ``pip`` module.
2020-08-20 01:32:04 -04:00
.. code-block:: console
2021-03-07 17:54:59 +03:00
$ pip install 'xonsh[full]'
2020-08-20 01:32:04 -04:00
2020-09-01 20:35:10 -04:00
This uses the pip 'extras' syntax, and is equivalent to:
2020-08-20 01:32:04 -04:00
.. code-block:: console
2020-09-01 20:35:10 -04:00
$ pip install pygments prompt-toolkit setproctitle xonsh
2020-08-20 01:32:04 -04:00
The above ``pip`` commands may have to be spelled ``pip3`` or ``sudo pip3`` if you are not installing in a virtual environment.
2022-07-01 21:17:01 +05:30
**source:** Pip can also install the most recent xonsh source code from the
2020-08-20 01:32:04 -04:00
`xonsh project repository <https://github.com/xonsh/xonsh>`_.
.. code-block:: console
$ pip install pygments prompt-toolkit setproctitle https://github.com/xonsh/xonsh/archive/main.zip
2020-08-20 01:32:04 -04:00
Spelling of ``pip`` command may likewise have to be amended as noted above.
**platform package managers**
2022-07-01 21:17:01 +05:30
Various operating system distributions have platform-specific package managers which may offer a xonsh package.
2020-08-20 01:32:04 -04:00
This may not be the most current version of xonsh, but it should have been tested for stability on that platform
by the distribution managers.
+---------------------------+-----------------------------+---------------------+
| OS or distribution | command | Package(s) |
+===========================+=============================+=====================+
| Debian/Ubuntu | ``$ [sudo] apt install`` | |
+---------------------------+-----------------------------+ pygments |
| Fedora | ``$ [sudo] dnf install`` | prompt-toolkit |
+---------------------------+-----------------------------+ setproctitle |
| Arch Linux | ``$ [sudo] pacman -S`` | xonsh |
+---------------------------+-----------------------------+ |
| OSX | ``$ [sudo] brew install`` | |
+---------------------------+-----------------------------+---------------------+
If you run into any problems, please let us know!
Fewer Prerequisites
--------------------
2022-07-01 21:17:01 +05:30
A design goal of Xonsh is to run in any environment that supports a (supported) Python interpreter, you
2020-08-20 01:32:04 -04:00
can install just the ``xonsh`` package (using any package manager).
.. code-block:: console
2020-09-01 20:35:10 -04:00
pip install xonsh
2020-08-20 01:32:04 -04:00
2022-07-01 21:17:01 +05:30
When it starts up, if xonsh does not find ``pygments`` or ``setproctitle`` packages, it simply does not colorize
or highlight syntax or set process title, respectively.
2020-08-20 01:32:04 -04:00
2022-07-01 21:17:01 +05:30
If it does not find ``prompt-toolkit`` package, it will
use the Python ``readline`` module (which reads configuration file ``.inputrc`` in a manner compatible with ``GNU readline``).
2020-08-20 01:32:04 -04:00
To ensure xonsh uses ``readline`` even if ``prompt-toolkit`` is installed, configure this in your
``.xonshrc`` file:
.. code-block:: xonshcon
2020-08-20 01:32:04 -04:00
$SHELL_TYPE = 'readline'
Windows
-------
On Windows 10, the separately-installable `Windows Terminal app`_ is recommended.
.. _`Windows Terminal app`: platform-issues.html#windows-terminal