Files
platformio-core/docs/installation.rst

161 lines
4.7 KiB
ReStructuredText
Raw Normal View History

2014-08-09 16:31:20 +03:00
.. _installation:
Installation
============
**PlatformIO** is written in `Python <https://www.python.org/downloads/>`_ and
works on Mac OS X, Linux, Windows OS and *ARM*-based credit-card sized
computers (`Raspberry Pi <http://www.raspberrypi.org>`_,
`BeagleBone <http://beagleboard.org>`_,
`CubieBoard <http://cubieboard.org>`_).
2014-11-21 21:06:32 +02:00
2015-02-15 21:12:25 +02:00
.. contents::
2014-11-21 21:06:32 +02:00
System requirements
-------------------
* **Operating systems:**
* Mac OS X
* Linux, +ARM
2014-11-21 21:06:32 +02:00
* Windows
* Python 2.6.x or Python 2.7.x(recommended)
2014-08-09 16:31:20 +03:00
All commands below should be executed in
`Command-line <http://en.wikipedia.org/wiki/Command-line_interface>`_
2015-08-22 22:27:35 +03:00
application (Terminal):
2014-08-09 16:31:20 +03:00
2015-08-22 22:27:35 +03:00
* Mac OS X / Linux *Terminal* application
* Windows ``cmd.exe`` application.
2014-08-09 16:31:20 +03:00
2015-08-22 22:27:35 +03:00
Installation options
2015-03-31 15:27:04 +03:00
--------------------
2015-08-22 22:27:35 +03:00
.. warning::
**Windows OS**: Please `Download the latest Python 2.7.x
<https://www.python.org/downloads/>`_ and install it.
2015-08-22 22:27:35 +03:00
**DON'T FORGET** to select ``Add python.exe to Path`` feature on the
"Customize" stage.
2015-08-22 22:27:35 +03:00
Please *choose one of* the following installation options:
2014-11-14 00:12:23 +02:00
Python Package Manager
~~~~~~~~~~~~~~~~~~~~~~
2015-08-25 15:11:23 +03:00
Run the following using `pip <https://pip.pypa.io>`_
(**MAY require** administrator access ``sudo``):
.. code-block:: bash
pip install --upgrade pip setuptools scons
2015-08-25 15:12:31 +03:00
pip install -U platformio
If your computer does not recognize ``pip`` command, try to install it first
using `these instructions <https://pip.pypa.io/en/latest/installing.html>`_.
Installer Script
~~~~~~~~~~~~~~~~
2014-11-14 00:12:23 +02:00
Super-Quick (Mac / Linux)
'''''''''''''''''''''''''
2014-11-14 00:12:23 +02:00
2014-11-14 00:17:09 +02:00
To install or upgrade *PlatformIO* paste that at a *Terminal* prompt
(**MAY require** administrator access ``sudo``):
2014-11-14 00:12:23 +02:00
.. code-block:: bash
python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
2014-11-14 00:12:23 +02:00
Local Download (Mac / Linux / Windows)
''''''''''''''''''''''''''''''''''''''
2014-08-09 16:31:20 +03:00
To install or upgrade *PlatformIO*, download (save as...)
`get-platformio.py <https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py>`_
script. Then run the following (**MAY require** administrator access ``sudo``):
2014-08-09 16:31:20 +03:00
.. code-block:: bash
2015-07-06 22:36:05 +03:00
2015-07-06 18:44:00 +03:00
# change directory to folder where is located downloaded "get-platformio.py"
cd /path/to/dir/where/is/located/get-platformio.py/script
2015-07-06 18:44:00 +03:00
# run it
2014-11-14 00:12:23 +02:00
python get-platformio.py
2014-08-09 16:31:20 +03:00
On *Windows OS* it may look like:
.. code-block:: bash
2015-07-06 18:44:00 +03:00
# change directory to folder where is located downloaded "get-platformio.py"
cd C:\path\to\dir\where\is\located\get-platformio.py\script
2015-07-06 18:44:00 +03:00
# run it
2014-08-09 16:31:20 +03:00
C:\Python27\python.exe get-platformio.py
Full Guide
2015-03-31 15:27:04 +03:00
~~~~~~~~~~
2014-08-09 16:31:20 +03:00
1. Check a ``python`` version (only 2.6-2.7 is supported):
.. code-block:: bash
python --version
2014-08-09 16:31:20 +03:00
*Windows Users* only:
2014-08-09 16:31:20 +03:00
* `Download Python 2.7 <https://www.python.org/downloads/>`_ and install it.
* Add to PATH system variable ``;C:\Python27;C:\Python27\Scripts;`` and
reopen *Command Prompt* (``cmd.exe``) application. Please read this
article `How to set the path and environment variables in Windows
<http://www.computerhope.com/issues/ch000549.htm>`_.
2. Install a ``platformio`` and related packages:
2014-08-09 16:31:20 +03:00
.. code-block:: bash
pip install --upgrade pip setuptools scons
pip install platformio
2014-08-09 16:31:20 +03:00
If your computer does not recognize ``pip`` command, try to install it first
using `these instructions <https://pip.pypa.io/en/latest/installing.html>`_.
For upgrading ``platformio`` to the latest version:
2014-08-09 16:31:20 +03:00
.. code-block:: bash
pip install --upgrade platformio
2014-08-09 16:31:20 +03:00
Development Version
2015-03-31 15:27:04 +03:00
~~~~~~~~~~~~~~~~~~~
.. warning::
We don't recommend to use ``develop`` version in production.
Install the latest PlatformIO from the ``develop`` branch:
.. code-block:: bash
pip install -U pip setuptools scons
pip install -U https://github.com/platformio/platformio/archive/develop.zip
If you want to be up-to-date with the latest ``develop`` version of PlatformIO,
then you need to re-install PlatformIO each time if you see the new commits in
`PlatformIO GitHub repository (branch: develop) <https://github.com/platformio/platformio/commits/develop>`_.
2015-08-22 22:27:35 +03:00
Troubleshooting
---------------
.. warning::
If you are going to run *PlatformIO* from **subprocess**, you
:ref:`MUST DISABLE <faq_troubleshooting_pioblocksprompt>` all prompts.
It will allow you to avoid blocking.
.. note::
**Linux OS**: Don't forget to install "udev" rules file
`99-platformio-udev.rules <https://github.com/platformio/platformio/blob/develop/scripts/99-platformio-udev.rules>`_ (an instruction is located in the file).
**Windows OS**: Please check that you have correctly installed USB driver
from board manufacturer
For further details, frequently questions, please refer to :ref:`faq`.