Use only installed Python on Windows#8226
Conversation
|
btw there's also |
platform.txt
Outdated
There was a problem hiding this comment.
{cmd} espota.py -E -> {cmd} -E -- espota.py?
assuming cmd expands to python.exe, arg is intended for python
(and also applies above, where python cmd is spelled out)
There was a problem hiding this comment.
Yes, I will update soon. That’s what I get for submitting PRs at 2am…
There was a problem hiding this comment.
Done with latest push. I was worried about -I and the scripts directory, but we don't have any cross-script dependencies so it does work fine.
For PlatformIO, it seems the builder script doesn't use the packages Python and relies on $PYTHONEXE which I assume is part of/required for Platform.IO.
There was a problem hiding this comment.
True, lgtm. (although, I'd still add -- for future's sake)
PIO itself needs system / bundled python to run, so it is slightly different there. e.g. with esptool, it just downloads a standalone script, since it already includes pyserial as it's core dependency
When Python is installed on Windows separately (i.e. Windows Store, Python.org MSI, etc.) it set the PYTHONHOME environment variable to the installed path. When we call our own portable Python, it tries to use the support PYC files in PYTHONHOME. If they're from a different version of Python, however, they won't work. Even though we're running our own distributed Python.exe, we are crashing on the system-wide Python installation. Add -I to all python3 calls, ignore PYTHONHOME/etc. environment vars. Tested under Ubuntu 18.04 Linux w/o any ill effects (we ship pyserial ourselves and add it manually to the Python search path). Fixes esp8266#8096, or should as I understand it.
4e4a255 to
e921440
Compare
d-a-v
left a comment
There was a problem hiding this comment.
Build and flash is OK under ubuntu
d-a-v
left a comment
There was a problem hiding this comment.
Compilation and flashing works under windows and arduino IDE.
tested using the alpha release.
When Python is installed on Windows separately (i.e. Windows Store,
Python.org MSI, etc.) it set the PYTHONHOME environment variable to
the installed path.
When we call our own portable Python, it tries to use the support
PYC files in PYTHONHOME. If they're from a different version of
Python, however, they won't work. Even though we're running our
own distributed Python.exe, we are crashing on the system-wide
Python installation.
Add -I to all python3 calls, ignore PYTHONHOME/etc. environment vars.
Tested under Ubuntu 18.04 Linux w/o any ill effects (we ship pyserial
ourselves and add it manually to the Python search path).
Fixes #8096, or should as I understand it.