PlatformIO Community

Install PlatformIO on VScode failure

Today I got a message about Support for ESP-IDF 4.1

I hit install and get this error ???

Error: Error: Traceback (most recent call last):
  File "c:\users\donvu\.platformio\penv\lib\site-packages\platformio\__main__.py", line 109, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "c:\users\donvu\.platformio\penv\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\donvu\.platformio\penv\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\users\donvu\.platformio\penv\lib\site-packages\platformio\commands\__init__.py", line 44, in invoke
    return super(PlatformioCLI, self).invoke(ctx)
  File "c:\users\donvu\.platformio\penv\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\donvu\.platformio\penv\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\donvu\.platformio\penv\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\donvu\.platformio\penv\lib\site-packages\platformio\commands\home\command.py", line 78, in cli
    contrib_dir = get_core_package_dir("contrib-piohome")
  File "c:\users\donvu\.platformio\penv\lib\site-packages\platformio\package\manager\core.py", line 37, in get_core_package_dir
    assert pm.install(spec)
  File "c:\users\donvu\.platformio\penv\lib\site-packages\platformio\package\manager\_install.py", line 49, in install
    spec, silent=silent, skip_dependencies=skip_dependencies, force=force
  File "c:\users\donvu\.platformio\penv\lib\site-packages\platformio\package\manager\_install.py", line 99, in _install
    pkg = self.install_from_registry(spec, search_filters, silent=silent)
  File "c:\users\donvu\.platformio\penv\lib\site-packages\platformio\package\manager\_registry.py", line 83, in install_from_registry
    package = self.fetch_registry_package(spec)
  File "c:\users\donvu\.platformio\penv\lib\site-packages\platformio\package\manager\_registry.py", line 144, in fetch_registry_package
    result = regclient.get_package(self.pkg_type, spec.owner, spec.name)
  File "c:\users\donvu\.platformio\penv\lib\site-packages\platformio\clients\registry.py", line 136, in get_package
    cache_valid="1h",
  File "c:\users\donvu\.platformio\penv\lib\site-packages\platformio\clients\http.py", line 145, in fetch_json_data
    return json.loads(result)
  File "C:\Users\donvu\AppData\Local\Programs\Python\Python37\Lib\json\__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "C:\Users\donvu\AppData\Local\Programs\Python\Python37\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\donvu\AppData\Local\Programs\Python\Python37\Lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================


	at c:\Users\donvu\.vscode\extensions\platformio.platformio-ide-1.10.0\node_modules\platformio-node-helpers\dist\index.js:1:11965
	at ChildProcess.d (c:\Users\donvu\.vscode\extensions\platformio.platformio-ide-1.10.0\node_modules\platformio-node-helpers\dist\index.js:1:8215)
	at ChildProcess.emit (events.js:203:13)
	at ChildProcess.cp.emit (c:\Users\donvu\.vscode\extensions\platformio.platformio-ide-1.10.0\node_modules\platformio-node-helpers\node_modules\cross-spawn\lib\enoent.js:34:29)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

What does this mean and how do I fix it ??

see

Maybe you have PIO core version 4 installed (check pio --version), but the new Espressif32 paltform version needs PIO 5.

1 Like

Could you run pio system prune and restart VSCode?

PS C:\Users\donvu> pio --version
PlatformIO, version 5.0.0
PS C:\Users\donvu> pio system prune
WARNING! This will remove:

  • cached API requests
  • cached package downloads
  • temporary data
    Do you want to continue? [y/N]: y
    Total reclaimed space: 29.89MB
    PS C:\Users\donvu>

To be clear, this was a new install of VSC and a new install of PIO from the Extensions Menu.

I re-installed PIO from the Extensions menu and there are no errors !!

Thank You

Would some one please explain what this command does.

See https://docs.platformio.org/en/latest/core/userguide/system/cmd_prune.html