-
-
Notifications
You must be signed in to change notification settings - Fork 803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make PlatformIO Python 3 compatible #895
Comments
PlatformIO's Build System depends on SCons tool that doesn't support Python 3. Please note that SCons team works in this way. |
@ivankravets How hard would it be to remove this dependency, or replace it with something else? Would it be feasible to write an adapter module that called out to SCons from Python 3? Although that would be a hassle when installing... Python 2 is quickly becoming irrelevant, and I'm finding myself having to keep a Python 2 env around just for PlatformIO. I think this should be a higher priority, as PlatformIO risks finding itself in a position where it can't be easily installed soon (with OSes moving to Py3). I would be willing to contribute some code to the migration to Py3. |
Python 2 is a stable and supported branch. I think, minimum 5 years all major OSs will include Python 2 distribution by default (as they now do). Hundred OS-dependent libraries and software are written in Python 2: macOS, Linux, BSD. Nevertheless, SCons Team hardly working on the first Python3 compatible release. |
Just noticed that it looks like SCons 3.0.0 just released support for python 3.5+! |
Upgraded to SCons 3.0 in PlatformIo Core 3.5.2 ( 59337c7 ). Now, need to upgrade PIO Core to Python 3. |
Add Python 3 support (backwards compatible with Python 2.7). See platformio#895. Note: platforms/packages containing Python code, e.g., [`platform-atmelavr`][1], still need to be updated to support Python 3. The [`python-modernize`][2] can help with this considerably, e.g.: python-modernize . -w will automatically use the [`six`][3] module to apply numerous transformations required for Python 2/3 compatability. The [`python-modernize`][2] tool was used for most Python 3 updates to `platformio-core` introduced by this merge, with the notable exception of unicode string handling, which required manual intervention (see below). Unicode issues -------------- In Python 3, **all** string literals (i.e., `str` objects) are **unicode** - **there is NO `unicode` type** in Python 3. In Python 3, the **`bytes` type** is equivalent to **`str` in Python 2**. Note that in Python 2 the `bytes` type may be used interchangeably with the `str` type. However, in Python 3 many library functions, e.g., `hashlib.md5.update` require `bytes` objects; **NOT `str` objects**. Thus, to work properly with Python 3, code ported from Python 2 must be updated to **explicitly decode** `str` unicode string objects to `bytes`, e.g., `my_string.encode('utf8')`. Furthermore, some Python 3 library functions now **return** `bytes` objects, e.g., `Popen.communicate`. Python 2 code interpreting the output of such functions as `str` string objects **MUST** be updated to explicitly encode the output to unicode strings to work properly in Python 3, e.g.: ```python process = subprocess.Popen(...) stdout, stderr = process.communicate() print(stdout.decode('utf8')) ``` [1]: https://github.com/platformio/platform-atmelavr.git [2]: https://github.com/python-modernize/python-modernize [3]: https://pythonhosted.org/six/
Platformio does not run on Python 3 yet. Tracking issue: platformio/platformio-core#895
Platformio does not run on Python 3 yet. Tracking issue: platformio/platformio-core#895
How can I install the specific version for Python3? It seems to be not OK, if I use
|
@mintisan As you can see in your That means Platformio is currently not Python 3 compatible. Hence this issue. 😉 You may want to try |
There is a pull request open for this and I would be happy to help get polish it up if someone could share what is blocking it at the moment. :) |
Hi all, Sorry for the delay. We have finally added full support for Python 3.5+. Of course, Python 2.7 is also in the supported list. We would be thankful if you re-test with Does it work for you? |
Awesome! Confirming install/run in Ubuntu 18.04 LTS! 🎉 👍 An existing platform.io project builds without issue. All tests, except one pass!
I have to log in? Ok.
Edit Again: it fails if I run this test with
|
Using a windows machine I can download the dev branch but still has the python 2.7.13 dependency |
@rab852 PlatformIO IDE currently depends on Python 2.7. Please open an issue here https://github.com/platformio/platformio-vscode-ide/issues |
Just saying...
|
You can use PlatformIO Core 4.0 which supports Python 3. See https://docs.platformio.org/en/latest/installation.html#development-version |
@ivankravets When PlatformeIO Core 4.0 will be released ? |
Configuration
Operating system:
Windows and Mac
PlatformIO Version (
platformio --version
):PlatformIO, version 3.2.1
Description of problem
PlatformIO is not compatible to Python 3 (as stated on the website). It would be nice and would ease the install process if PlatformIO would also work with Python 3.
The text was updated successfully, but these errors were encountered: