Python 3.4 or greater required, but you have Python 2.7.15

Python 3.4 or greater required, but you have Python 2.7.15

it’s happened on ubuntu 18: platform-ststm32 examples with zephyr

Have you tried installing python3 then? :stuck_out_tongue:

Depending on when you installed PlatformIO, there is a good chance the default version of python on your system was a 2.x version of Python, hence PlatformIO will still be using that. Since then, I’m pretty sure the default version is now python3, and you’ll need to give PlatformIO a kick to get it to change. Since it works in a virtualenv, it may be possible to change that, but I don’t know how to go about doing that.
It may be simpler to remove the ~/.platformio folder, and let the VSCode PlatformIO extension reinstall PlatformIO when you restart VSCode (if you are using VSCode?). Otherwise, if you are using the CLI version of PlatformIO, since it is installed via pip, you’d probably have to remove it through pip, and then install it again using pip (or pip3, to force the issue)…

2 Likes

Zephyr RTOS depends on Python 3. Please install Python 3, remove ~/.platformio/penv folder and restart VSCode.

1 Like

I can never remove /home/qitas/.platformio/penv/bin/python , there is the version python2.7.15,However ,I have del ~/.platformio/penv and reload VSCode.

So when you run python --version from a PlatformIO terminal (last/rightmost icon at the bottom left of the VSCode window) does it report a never version than 2.7.15 now? Otherwise, you’ll need to try again, ensuing VSCode is not running, and that there are no python processes running.