| 1 | --- |
| 2 | title: Installing |
| 3 | --- |
| 4 | |
| 5 | PyOCD requires [Python](https://python.org/) 3.9 or later. It runs on macOS, |
| 6 | Linux, FreeBSD, and Windows platforms. |
| 7 | |
| 8 | The latest pyOCD package is available [on PyPI](https://pypi.python.org/pypi/pyOCD/). The |
| 9 | [GitHub releases](https://github.com/pyocd/pyOCD/releases) page details changes between versions. |
| 10 | |
| 11 | The latest stable version of pyOCD may be installed or upgraded via [pip](https://pip.pypa.io/en/stable/index.html) |
| 12 | as follows: |
| 13 | |
| 14 | ``` |
| 15 | $ python3 -m pip install -U pyocd |
| 16 | ``` |
| 17 | |
| 18 | _Note: depending on your system, you may need to use `python` instead of `python3`._ |
| 19 | |
| 20 | We also recommend using [pipx](https://pypa.github.io/pipx/) as an excellent method to install pyOCD in an isolated |
| 21 | virtual Python environment. |
| 22 | |
| 23 | |
| 24 | ### PE Micro probe support |
| 25 | |
| 26 | Support for Cyclone and/or Multilink debug probes by [PE Micro](https://pemicro.com/) is available in a probe |
| 27 | driver plug-in that is a separate package from pyOCD. There are two ways to install the PE Micro probe plug-in. |
| 28 | Either substitute `pyocd[pemicro]` for `pyocd` in the commands above, or separately install `pyocd-pemicro` |
| 29 | using pip. |
| 30 | |
| 31 | ### Segger J-Link probe support |
| 32 | |
| 33 | To access Segger J-Link debug probes, first install the [J-Link driver package](https://www.segger.com/downloads/jlink/). |
| 34 | |
| 35 | |
| 36 | ### Permissions issues |
| 37 | |
| 38 | Note that, depending on your operating system, you may run into permissions issues running these commands. |
| 39 | You have a few options here: |
| 40 | |
| 41 | 1. Install with [pipx](https://pypa.github.io/pipx/). |
| 42 | 2. Run the command in a [virtualenv](https://virtualenv.pypa.io/en/latest/) |
| 43 | local to a specific project working set. |
| 44 | 3. Under Linux, run with `sudo -H` to install pyOCD and dependencies globally. On macOS, installing with sudo |
| 45 | should never be required, although sometimes permissions/corrupted can become modified such that installing without |
| 46 | using sudo fails. |
| 47 | 4. Specify the `--user` option to install local to your user account. |
| 48 | |
| 49 | |
| 50 | ### Non-x86 systems |
| 51 | |
| 52 | For notes about installing and using on non-x86 systems such as Raspberry Pi, see the |
| 53 | [relevant documentation]({% link _docs/installing_on_non_x86.md %}). |
| 54 | |
| 55 | |
| 56 | ### Development versions |
| 57 | |
| 58 | To install the latest prerelease version from the HEAD of the `develop` branch, you can do |
| 59 | the following: |
| 60 | |
| 61 | ``` |
| 62 | $ python3 -m pip install --pre -U git+https://github.com/pyocd/pyOCD.git@develop |
| 63 | ``` |
| 64 | |
| 65 | You can also install directly from the source by cloning the [git repository](https://github.com/pyocd/pyOCD) and |
| 66 | running this command from the working copy root directory: |
| 67 | |
| 68 | ``` |
| 69 | $ python3 -m pip install . |
| 70 | ``` |
| 71 | |
| 72 | See the [developer's guide]({% link _docs/developers_guide.md %}) for more about setting up a development |
| 73 | environment for pyOCD. |
| 74 | |
| 75 | (Note: Installing by running `setup.py` directly is deprecated since pyOCD migrated to PEP 517 based packaging. |
| 76 | In many cases it will not work at all. Installing with pip or another standards-compliant tool is the only |
| 77 | supported method.) |
| 78 | |
| 79 | |
| 80 | udev rules on Linux |
| 81 | ------------------- |
| 82 | |
| 83 | On Linux, particularly Ubuntu 16.04+, you must configure udev rules to allow pyOCD to access debug |
| 84 | probes from user space. Otherwise you will need to run pyOCD as root, using sudo, which is very |
| 85 | highly discouraged. (You should _never_ run pyOCD as root on any OS.) |
| 86 | |
| 87 | To help with this, example udev rules files are included with pyOCD in the |
| 88 | [udev](https://github.com/pyocd/pyOCD/tree/main/udev) folder. The |
| 89 | [readme](https://github.com/pyocd/pyOCD/tree/main/udev/README.md) in this folder has detailed |
| 90 | instructions. |
| 91 | |
| 92 | |
| 93 | Target support |
| 94 | -------------- |
| 95 | |
| 96 | See the [target support documentation]({% link _docs/target_support.md %}) for information on how to check if |
| 97 | the MCU(s) you are using have built-in support, and how to install support for additional MCUs via |
| 98 | CMSIS-Packs. |
| 99 | |
| 100 | |
| 101 |