Skip to content

Commit af6575e

Browse files
committed
Drop support for Python 2 and 3.5
1 parent 164a38d commit af6575e

File tree

2 files changed

+25
-106
lines changed

2 files changed

+25
-106
lines changed

core/installation.rst

Lines changed: 2 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ System requirements
3939
:Operating System: Windows, macOS, Linux, FreeBSD, Linux ARMv6+
4040
:Python Interpreter:
4141

42-
Python 3.5+ (Python 2.7 is not recommended, support for it will be removed in the next releases).
43-
See detailed instruction on how to :ref:`faq_install_python` for Windows.
42+
**Python 3.6+ or above**. See detailed instruction on how to :ref:`faq_install_python`.
4443

4544
:Terminal Application:
4645

@@ -157,109 +156,6 @@ macOS Homebrew Packages Manager (`brew <http://brew.sh/>`_) as follows:
157156
158157
brew install platformio
159158
160-
Virtual Environment
161-
~~~~~~~~~~~~~~~~~~~
162-
163-
PlatformIO Core may be installed into isolated Python environment. This
164-
method is very good if you don't want to install PlatformIO Core Python's
165-
dependencies (packages) into your global system scope. :ref:`pioide` uses this
166-
method to install PlatformIO Core.
167-
168-
Default and recommended environment folder is ":ref:`projectconf_pio_core_dir`/penv".
169-
You can print **environment folder path** using the next command in your
170-
system terminal:
171-
172-
.. code-block:: bash
173-
174-
python -c "import os; print(os.path.join(os.getenv('PLATFORMIO_CORE_DIR', os.path.join(os.path.expanduser('~'), '.platformio')), 'penv'))"
175-
176-
######################## Examples
177-
# Windows
178-
# C:\Users\UserName\.platformio\penv
179-
180-
# Linux
181-
# ~/.platformio/penv
182-
# /home/username/.platformio/penv
183-
184-
# macOS
185-
# ~/.platformio/penv
186-
# /Users/username/.platformio/penv
187-
188-
Prerequisites
189-
'''''''''''''
190-
191-
1. Please remove existing PlatformIO Core **environment folder** if exists.
192-
See above command how to get path to environment folder.
193-
194-
2. Please check that you have a valid Python interpreter running a next
195-
command in system terminal. Python 2.7.9+ or Python 3.5+ is recommended.
196-
197-
.. code-block:: bash
198-
199-
python --version
200-
201-
# or, for Unix (Linux, Mac), you can use `python2` or `python3` aliases
202-
python2 --version
203-
python3 --version
204-
205-
.. warning::
206-
**Windows Users**: If you already tried to install :ref:`pioide` and did
207-
not get success, please open system's Control Panel > Installed Programs,
208-
and check if PlatformIO IDE tried to install an own isolated Python 2.7
209-
version. Please uninstall it. Also is good to uninstall all Python
210-
interpreters from a system and install manually the latest Python
211-
using :ref:`faq_install_python` guide.
212-
213-
3. Make sure ``virtualenv --help`` command exists in a system, otherwise,
214-
please install it manually using ``pip install virtualenv`` or
215-
``pip2 install virtualenv`` command.
216-
217-
If ``pip`` (Python Package Manager) does not exists, you have to install it
218-
manually. See https://pip.pypa.io/en/stable/installing/
219-
220-
Creating
221-
''''''''
222-
223-
1. Create a folder which contains all the necessary executables to use the
224-
packages that PlatformIO Core would need using ``virtualenv`` command:
225-
226-
.. code-block:: bash
227-
228-
virtualenv /path/to/.platformio/penv
229-
230-
# If you want to use a custom Python interpreter
231-
virtualenv --python=/path/to/custom/python /path/to/.platformio/penv
232-
233-
# EXAMPLES
234-
# Windows
235-
virtualenv C:\Users\UserName\.platformio\penv
236-
virtualenv --python=C:\Python27\python.exe C:\Users\UserName\.platformio\penv
237-
238-
# Unix (Linux, Mac)
239-
virtualenv ~/.platformio/penv
240-
virtualenv -p python3 ~/.platformio/penv
241-
242-
2. Activate virtual environment
243-
244-
.. code-block:: bash
245-
246-
# Windows
247-
C:\Users\UserName\.platformio\penv\Scripts\activate
248-
249-
# Unix (Linux, Mac)
250-
source /path/to/.platformio/penv/bin/activate
251-
# or
252-
. /path/to/.platformio/penv/bin/activate
253-
254-
3. Install PlatformIO Core into virtual environment
255-
256-
.. code-block:: bash
257-
258-
pip install -U platformio
259-
260-
If you plan to use PlatformIO Core commands outside virtual environment, please
261-
:ref:`piocore_install_shell_commands`.
262-
263159
.. _installation_develop:
264160

265161
Development Version
@@ -414,7 +310,7 @@ Python Interpreter
414310
''''''''''''''''''
415311

416312
PlatformIO Core Installer Script is written in Python and is compatible with Python 2.7+
417-
and Python 3.5+. **We highly recommend using Python 3**.
313+
and Python 3.5+. **We highly recommend using the latest Python 3**.
418314

419315
Python is installed by default on the most popular Unix OS (macOS, Linux, FreeBSD).
420316
If there is no Python on a user machine (you can check running ``python --version``),

core/migration.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,29 @@ for more details.
141141
What is changed or removed
142142
--------------------------
143143

144+
Drop support for Python 2 and 3.5
145+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146+
147+
Python 2.7 is reached the `end of its life on 1 January 2020 <https://en.wikipedia.org/wiki/History_of_Python#Table_of_versions>`_,
148+
and Python Software Foundation will not provide any security fixes for it. The same
149+
situation with Python 3.5.
150+
151+
To avoid unrelated issues to the PlatformIO Core, we decided to drop support for
152+
Python 2 and 3.5. **The minimum supported version for PlatformIO Core 5.0 is Python 3.6.**
153+
154+
If you use :ref:`pioide`, it already comes with the built-in compatible Python 3 interpreter.
155+
You do not need to do any extra steps. If you see a warning message that your local
156+
PlatformIO Core installation uses incompatible Python, please do the next steps:
157+
158+
1. Install the latest Python 3 following this guide :ref:`faq_install_python`
159+
2. Open system terminal and type ``python3 --version`` or ``python.exe --version`` (for Windows).
160+
The output should contain a version of Python 3.6 or above (depending on which you installed it).
161+
3. Remove PlatformIO Core installation "penv" folder that is located by this path
162+
``USER_HOME_DIR/.platformio/penv``. If you use Windows and your user name contains non-ASCII
163+
chars the "penv" folder is located in ``C:/.platformio/penv``
164+
4. Install PlatformIO Core using :ref:`installation_installer_script`
165+
5. Run the :ref:`cmd_system_info` command and ensure that Python 3 is used.
166+
144167
Introducing Strict SSL/TLS
145168
~~~~~~~~~~~~~~~~~~~~~~~~~~
146169

0 commit comments

Comments
 (0)