File: install.rst

package info (click to toggle)
python-evdev 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 416 kB
  • sloc: python: 1,388; ansic: 739; makefile: 142; sh: 14
file content (100 lines) | stat: -rw-r--r-- 3,081 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
99
100
From an OS package
==================

Python-evdev has been packaged for the following distributions:

.. raw:: html

    <a href="https://repology.org/project/python:evdev/versions">
      See Repology&rsquo;s version information.
    </a>

Consult the documentation of your OS package manager for installation instructions.


From source
===========

The latest stable version of *python-evdev* can be installed from pypi_,
provided that you have a compiler, pip_ and the Python and Linux development
headers installed on your system. Installing these is distribution specific and
typically falls into one of the following:

On a Debian compatible OS:

.. code-block:: bash

    $ apt install python-dev python-pip gcc
    $ apt install linux-headers-$(uname -r)

On a Redhat compatible OS:

.. code-block:: bash

    $ dnf install python-devel python-pip gcc
    $ dnf install kernel-headers-$(uname -r)

On Arch Linux and derivatives:

.. code-block:: bash

    $ pacman -S core/linux-api-headers python-pip gcc

Once all OS dependencies are available, you may install *python-evdev* using
pip_, preferably in a [virtualenv]_:

.. code-block:: bash

    # Install globally (not recommended).
    $ sudo python3 -m pip install evdev

    # Install for the current user.
    $ python3 -m pip install --user evdev

    # Install in a virtual environment.
    $ python3 -m venv abc
    $ source abc/bin/activate
    $ python3 -m pip install evdev


Specifying header locations
---------------------------

By default, the setup script will look for the ``input.h`` and
``input-event-codes.h`` [#f1]_ header files ``/usr/include/linux``.

You may use the ``--evdev-headers`` option to the ``build_ext`` setuptools
command to the location of these header files. It accepts one or more
colon-separated paths. For example:

.. code-block:: bash

    $ python setup.py build_ext \
        --evdev-headers buildroot/input.h:buildroot/input-event-codes.h \
        --include-dirs  buildroot/ \
        install  # or any other command (e.g. develop, bdist, bdist_wheel)


From a binary package
=====================

You may choose to install a precompiled version of *python-evdev* from pypi. The
`evdev-binary`_ package provides binary wheels that have been compiled on EL8
against the 4.18.0 kernel headers.

.. code-block:: bash

    $ python3 -m pip install evdev-binary

While the evdev interface is stable, the precompiled version may not be fully
compatible or expose all the features of your running kernel. For best results,
it is recommended to use an OS package or to install from source.


.. [#f1] ``input-event-codes.h`` is found only in recent kernel versions.
.. _pypi:              http://pypi.python.org/pypi/evdev
.. _evdev-binary:      http://pypi.python.org/pypi/evdev-binary
.. _github:            https://github.com/gvalkov/python-evdev
.. _pip:               http://pip.readthedocs.org/en/latest/installing.html
.. _example:           https://github.com/gvalkov/python-evdev/tree/master/examples
.. _virtualenv:        https://docs.python.org/3/library/venv.html