| 1 |
========== |
| 2 |
Installing |
| 3 |
========== |
| 4 |
|
| 5 |
|
| 6 |
.. note:: |
| 7 |
These instructions cover Paramiko 2.0 and above. If you're looking to |
| 8 |
install Paramiko 1.x, see :doc:`installing-1.x`. However, **the 1.x line |
| 9 |
relies on insecure dependencies** so upgrading is strongly encouraged. |
| 10 |
|
| 11 |
|
| 12 |
.. _paramiko-itself: |
| 13 |
|
| 14 |
Paramiko itself |
| 15 |
=============== |
| 16 |
|
| 17 |
The recommended way to get Paramiko is to **install the latest stable release** |
| 18 |
via `pip <http://pip-installer.org>`_:: |
| 19 |
|
| 20 |
$ pip install paramiko |
| 21 |
|
| 22 |
Paramiko has only a few **direct dependencies**: |
| 23 |
|
| 24 |
- The big one, with its own sub-dependencies, is Cryptography; see :ref:`its |
| 25 |
specific note below <cryptography>` for more details; |
| 26 |
- `bcrypt <https://pypi.org/project/bcrypt/>`_ and `pynacl |
| 27 |
<https://pypi.org/project/PyNaCl/>`_ for Ed25519 key support. |
| 28 |
|
| 29 |
There are also a handful of **optional dependencies** you may install using |
| 30 |
`setuptools 'extras' |
| 31 |
<https://packaging.python.org/tutorials/installing-packages/#installing-setuptools-extras>`_: |
| 32 |
|
| 33 |
|
| 34 |
.. _release-lines: |
| 35 |
|
| 36 |
Release lines |
| 37 |
------------- |
| 38 |
|
| 39 |
Users desiring stability may wish to pin themselves to a specific release line |
| 40 |
once they first start using Paramiko; to assist in this, we guarantee bugfixes |
| 41 |
for the last 2-3 releases including the latest stable one. |
| 42 |
|
| 43 |
This typically spans major & minor versions, so even if e.g. 3.1 is the latest |
| 44 |
stable release, it's likely that bugfixes will occasionally come out for the |
| 45 |
latest 2.x and perhaps even 1.x releases, as well as for 3.0. New feature |
| 46 |
releases for previous major-version lines are less likely but not unheard of. |
| 47 |
|
| 48 |
If you're unsure which version to install: |
| 49 |
|
| 50 |
* **Completely new users** should always default to the **latest stable |
| 51 |
release** (as above, whatever is newest / whatever shows up with ``pip |
| 52 |
install paramiko``.) |
| 53 |
* **Users upgrading from a much older version** (e.g. 1.7.x through 1.10.x) |
| 54 |
should probably get the **oldest actively supported line** (check the |
| 55 |
:doc:`changelog` for recent releases). |
| 56 |
* **Everybody else** is hopefully already "on" a given version and can |
| 57 |
carefully upgrade to whichever version they care to, when their release line |
| 58 |
stops being supported. |
| 59 |
|
| 60 |
|
| 61 |
.. _cryptography: |
| 62 |
|
| 63 |
Cryptography |
| 64 |
============ |
| 65 |
|
| 66 |
`Cryptography <https://cryptography.io>`__ provides the low-level (C-based) |
| 67 |
encryption algorithms we need to implement the SSH protocol. It has detailed |
| 68 |
`installation instructions`_ (and an `FAQ |
| 69 |
<https://cryptography.io/en/latest/faq/>`_) which you should read carefully. |
| 70 |
|
| 71 |
In general, you'll need one of the following setups: |
| 72 |
|
| 73 |
* On Windows or Mac OS X, provided your ``pip`` is modern (8.x+): nothing else |
| 74 |
is required. ``pip`` will install statically compiled binary archives of |
| 75 |
Cryptography & its dependencies. |
| 76 |
* On Linux, or on other platforms with older versions of ``pip``: you'll need a |
| 77 |
C build toolchain, plus development headers for Python, OpenSSL and |
| 78 |
``libffi``. Again, see `Cryptography's install docs`_; these requirements may |
| 79 |
occasionally change. |
| 80 |
|
| 81 |
.. warning:: |
| 82 |
If you go this route, note that **OpenSSL 1.0.1 or newer is effectively |
| 83 |
required**. Cryptography 1.3 and older technically allow OpenSSL 0.9.8, but |
| 84 |
1.4 and newer - which Paramiko will gladly install or upgrade, if you e.g. |
| 85 |
``pip install -U`` - drop that support. |
| 86 |
|
| 87 |
* Similarly, Cryptography 3.4 and above require Rust language tooling to |
| 88 |
install from source; once again see Cryptography's documentation for details |
| 89 |
here, such as `their Rust install section`_ and `this FAQ entry`_. |
| 90 |
|
| 91 |
.. _installation instructions: |
| 92 |
.. _Cryptography's install docs: https://cryptography.io/en/latest/installation.html |
| 93 |
.. _their Rust install section: https://cryptography.io/en/latest/installation.html#rust |
| 94 |
.. _this FAQ entry: https://cryptography.io/en/latest/faq.html#installing-cryptography-fails-with-error-can-not-find-rust-compiler |