File: packages.rst

package info (click to toggle)
xonsh 0.13.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,024 kB
  • sloc: python: 46,350; makefile: 136; sh: 41; xml: 17
file content (98 lines) | stat: -rw-r--r-- 3,946 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Package Manager
===============

You can install xonsh using ``conda``, ``pip`` or the package manager for
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.
  :pygments: for xonsh and Python syntax-specific highlighting
  :setproctitle: updates process title (in terminal window and process monitor) to match Xonsh arguments.

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
described in `fewer prerequisites`_


**conda:**

.. code-block:: console

    $ conda config --add channels conda-forge
    $ conda install xonsh


**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.

.. code-block:: console

    $ pip install 'xonsh[full]'

This uses the pip 'extras' syntax, and is equivalent to:

.. code-block:: console

    $ pip install pygments prompt-toolkit setproctitle xonsh

The above ``pip`` commands may have to be spelled ``pip3`` or ``sudo pip3`` if you are not installing in a virtual environment.

**source:** Pip can also install the most recent xonsh source code from the
`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

Spelling of ``pip`` command may likewise have to be amended as noted above.

**platform package managers**
Various operating system distributions have platform-specific package managers which may offer a xonsh package.
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
--------------------

A design goal of Xonsh is to run in any environment that supports a (supported) Python interpreter, you
can install just the ``xonsh`` package (using any package manager).

.. code-block:: console

    pip install xonsh

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.

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``).
To ensure xonsh uses ``readline`` even if ``prompt-toolkit`` is installed, configure this in your
``.xonshrc`` file:

.. code-block:: xonshcon

    $SHELL_TYPE = 'readline'

Windows
-------

On Windows 10, the separately-installable `Windows Terminal app`_ is recommended.

.. _`Windows Terminal app`: platform-issues.rst#windows-terminal