summaryrefslogtreecommitdiff
path: root/docs/installation.rst
blob: 61428ce043d201bcc9728cbbb65eaa0ed7b8f687 (plain)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
Installing OAuthLib
===================


Install from PyPI
-----------------

The recommended way to install OAuthLib is from PyPI using the *pip*
program. Either just the *standard install* by itself or *with extras
for RSA*.

Standard install
^^^^^^^^^^^^^^^^

A standard installation contains the core features of OAuthLib. It can
be installed by running:

.. code-block:: bash

    pip install oauthlib

To reduce its requirements, the Python packages needed for RSA
public-key cryptography are not included in the standard installation.


With extras for RSA
^^^^^^^^^^^^^^^^^^^

To support features that use RSA public-key cryptography, PyCA's
`cryptography`_ package and the `PyJWT`_ package must also be
installed. This can be done by installing the core features of
OAuthLib along with the "signedtoken" extras.

.. code-block:: bash

    pip install 'oauthlib[signedtoken]'

Note: the quotes may be required, since shells can interpret the
square brackets as special characters.

Alternatively, those two Python packages can be installed manually by
running ``pip install cryptography`` and ``pip install pyjwt``, either
before or after installing the standard installation of OAuthLib.
PyJWT depends on cryptography, so just installing *pyjwt* should
automatically also install *cryptography*. But *cryptography* has
dependencies that can cause its installation to fail, so it can be
better to get it installed before installing PyJWT.

Install from operating system distribution
------------------------------------------

Alternatively, install it from the operating system distribution's
packaging system, if OAuthLib is available as a distribution package.
Install instructions for some distributions are shown below.

The distribution packages usually only contain the standard install of
OAuthLib. To enable support for RSA, the *cryptography* and *pyjwt*
Python packages also need to be installed: either from the
distribution packages (if available) or from PyPI.

Debian and derivatives like Ubuntu, Mint, etc.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

    apt-get install python3-oauthlib

The Python2 package is called "python-oauthlib".

RHEL, CentOS and Fedora
^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

    yum install python3-oauthlib

The Python2 package is called "python2-oauthlib", and is available on
some distributions (e.g.Fedora 31 and CentOS 7) but not available on
others (e.g. CentOS 8).

For CentOS, the Python3 package is only available on CentOS 8 and
higher.

openSUSE
^^^^^^^^

.. code-block:: bash

    zypper in python3-oauthlib

The Python2 package is called "python-oauthlib".

Gentoo
^^^^^^

.. code-block:: bash

    emerge oauthlib

Arch
^^^^

.. code-block:: bash

    pacman -S python-oauthlib

The Python2 package is called "python2-oauthlib".

FreeBSD
^^^^^^^

.. code-block:: bash

    pkg_add -r security/py-oauthlib/


Install from GitHub
-------------------

Alternatively, install it directly from the source repository on
GitHub.  This is the "bleeding edge" version, but it may be useful for
accessing bug fixes and/or new features that have not been released.

Standard install
^^^^^^^^^^^^^^^^

The standard installation contains the core features of OAuthLib.

.. code-block:: bash

    pip install -e git+https://github.com/oauthlib/oauthlib.git#egg=oauthlib

With extras for RSA
^^^^^^^^^^^^^^^^^^^

To support features that use RSA public-key cryptography, install the
core features of OAuthLib along with the "signedtoken" extras.

.. code-block:: bash

    pip install -e 'git+https://github.com/oauthlib/oauthlib.git#egg=oauthlib[signedtoken]'

Note: the quotes may be required, since shells can interpret the
square brackets as special characters.

.. _`cryptography`: https://cryptography.io/
.. _`PyJWT`: https://pyjwt.readthedocs.io/