Can't build ESP8266 after pio update - "Unknown development platform 'espressif8266'"

working build, no changes, but tried a Pio Update this morning, and got the following:

Updating platformio/espressif8266 3.2.0 [Updating to 4.0.1]
Platform Manager: Installing platformio/espressif8266 @ 4.0.1
Downloading [####################################] 100%
Unpacking [####################################] 100%
Platform Manager: espressif8266 @ 4.0.1 has been installed!
Error: Unknown development platform ‘espressif8266’

now I just get Error: Unknown development platform ‘espressif8266’ with any pio update and compile fails with the same error

Running CLion plugin - just tried a “reinit” and a “clean” and an “updateall” from PIO plugin menu and got same error for all

Googled “Error: Unknown development platform ‘espressif8266’” and got no exact hits - so here I am …

Surely someone else has seen this?

I’ve never seen that before. Can you remove all folders in <home folder>/.platformio/platforms/ and do pio platform install espressif8266 in the commandline?

deleted platform folder contents as requested - then ran command from clion terminal and:

C:\work\N7Tech\4Mation\arduino\4mation> pio platform install espressif8266
Platform Manager: Installing espressif8266
Unpacking [####################################] 100%
Platform Manager: espressif8266 @ 4.0.1 has been installed!
Error: Unknown development platform ‘espressif8266’
PS C:\work\N7Tech\4Mation\arduino\4mation>

Platforms folder has an espressif8266 folder with lots of stuff in it

compile error is different now - much more verbose, starts with:
Platform Manager: Installing https://pythonlatform-espressif8266.git
Error: Please read Redirecting...
Platform Manager: Error: Traceback (most recent call last):

  • File “C:\python\lib\site-packages\platformio\commands\platform.py”, line 322, in init_platform*
  • return PlatformFactory.new(name)*
  • File “C:\python\lib\site-packages\platformio\platform\factory.py”, line 54, in new*
  • raise UnknownPlatform(pkg_or_spec)*
    platformio.platform.exception.UnknownPlatform: Unknown development platform ‘https://pythonlatform-espressif8266.git

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  • File “C:\python\lib\site-packages\urllib3\connection.py”, line 174, in _new_conn*
  • conn = connection.create_connection(*

and then piles more

You seem to have installed PlatformIO in the global Python installation – that can cause very weird problems.

Please:

hmmm - don’t understand that, pio was installed in user-home/.platformio

one thing I did after deleting the platforms folder in first reply was I tried the CLion plugin “home” command which did a bunch of stuff I didn’t expect including starting a local webserver - maybe that had something to do with my weird compiler output the second time.

Anyway - a complete delete and re-install seems to have done the trick - but the clion plugin still seems to need a bit extra to work

so for anyone else wanting the explicit steps :
delete pio installation
re-install via installer script (python get-platformio.py)
install platform ( pio platform install espressif8266)
uninstall clion pio plugin
install clion pio plugin

now for the extra bit :
start git bash client (for windows), change to your project directory and run " platformio init --ide clion"

1 Like

May I ask why it is not supported to install PlatformIO in the global Python installation? This is the standard way Python packages are installed on most common Linux distributions, including mine (an Ubuntu derivative). Do you offer an alternative Debian package which could be installed in place of the one that is in the official repos?

For regular users it’s not recommneded, but it is the standard way of installing it in a CI environment, e.g., Github Actions, et cetara.

The base concern is interfering with existing user-installed python packages and the OS, see Default terminal idea - #2 by ivankravets and the “WARNING” in the docs.

I’ve only ever seen distributations try and package PlatformIO, but these quickly get outdated, as the PlatformIO core is updated rather often, and distributions are slow. Not seen any .deb redistribution of the PlatformIO made by PlatformIO staff yet – right @ivankravets?

1 Like

Python’s PyPi does not manage dependencies in a way that npm does (installed sub-dependencies to the nested folders). As a result, 2 or more Python packages can conflict due to the different version requirements. For example, PlatformIO Core depends on Click >=8, whereas Debian/Ubuntu can potentially ship outdated Python packages that depend on Click 6. In this case, if PyPi upgrades click to the latest version, other systems packages will be broken.

The only solution to this is using Python virtual environments. You can create it manually, but we recommend using PlatformIO Core installer script that automatically does all works for you:

  1. Creates a virtual environment in ~/.platformio/penv
  2. Install PlatformIO Core dependencies into the isolated environments
  3. You can later symlink ~/.platformio/penv/bin/pio to /usr/local/bin/pio.