PlatformIO Community

PlatformIO has stopped working

Hi!

Last monday, PlatformIO could not load a Home tab with no apparent reason.

Environment:

  • Win7
  • VSCode 1.70.3
  • Python 3.8.9

After several checks that showed nothing (seemingly) wrong, I’ve done a lot of measures, some more than once, all ineffective:

  • remove PlatformIO and reinstall it
  • remove VSCode and reinstall it
  • remove Python v3.8.9 and reinstall it.
  • Remove remaining folders like “.platformio”, “.vscode” after uninstalling related software

Looking for such a problem I’ve found several cases since 2018, but solutions presented have been worthless.

Below, some screenshots that may be useful.

Any clue?

image

image

"Error: Traceback (most recent call last):
File “C:.platformio.cache\tmp.piocore-installer-bdgxnu4j\tmpvt8gwb69\pioinstaller.zip\pioinstaller\core.py”, line 169, in check
File “C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\subprocess.py”, line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\subprocess.py”, line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘[‘C:\.platformio\penv\Scripts\platformio.exe’, ‘–help’]’ returned non-zero exit status 1.

During handling of the above exception, another excep…"

image

image

Why is trying to do it in C:\.platformio? It should pick <user directory>\.platformio here. Did you run VSCode as admin? Did you try running it without?

Otherwise I would suggest

  1. Deactivate the CMake Tools extension
  2. Remove C:\Users\<user>\.platformio (or C:\.platformio if it exists)
  3. Restart VSCode, let the extension reinstall it’s core.

Hi, Maxgerhardt. Thanks for your help.

I’ve created a directory “C:.platformio” as one of the tries suggested at https://github.com/platformio/platformio-core-installer/issues/221

Yep, VSCode has always been run as admin.

“C:.platformio” and “C:<user>.platformio” were deleted, CMake and CMake Tools were uninstalled: same problem

image

"Error: Traceback (most recent call last):
File “C:\Users\Admin.platformio.cache\tmp.piocore-installer-7jwavxns\tmpz0jyoy8x\pioinstaller.zip\pioinstaller\core.py”, line 169, in check
File “C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\subprocess.py”, line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File “C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\subprocess.py”, line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘[‘C:\Users\Admin\.platformio\penv\Scripts\platformio.exe’, ‘–help’]’ returned non-zero exit status 1.

During handling of the abov…"

Does this file exist now?

If yes, what happens when you open a terminal (Windows+R → cmd.exe) and execute C:\Users\Admin\.platformio\penv\Scripts\platformio.exe --help?

Yes, there’s platformio.exe in that folder and when it is run (C:\Users\Admin.platformio\penv\Scripts>platformio.exe --help), that results:

"Error: Traceback (most recent call last):
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\platformio\__main__.py", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1054, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 920, in make_context
    self.parse_args(ctx, args)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1613, in parse_args
    rest = super().parse_args(ctx, args)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1378, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 2360, in handle_parse_result
    value = self.process_value(ctx, value)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 2322, in process_value
    value = self.callback(ctx, self, value)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1273, in show_help
    echo(ctx.get_help(), color=ctx.color)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 699, in get_help
    return self.command.get_help(self)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1298, in get_help
    self.format_help(ctx, formatter)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1331, in format_help
    self.format_options(ctx, formatter)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1533, in format_options
    self.format_commands(ctx, formatter)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1586, in format_commands
    cmd = self.get_command(ctx, subcommand)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\platformio\cli.py", line 80, in get_command
    module = importlib.import_module(commands[cmd_name])
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\platformio\commands\ci.py", line 24, in <module>
    from platformio.project.commands.init import project_init_cmd, validate_boards
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\platformio\project\commands\init.py", line 55, in <module>
    @click.option("--ide", type=click.Choice(ProjectGenerator.get_supported_ides()))
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\platformio\project\integration\generator.py", line 62, in get_supported_ides
    for name in os.listdir(tpls_dir)
FileNotFoundError: [WinError 3] O sistema não pode encontrar o caminho especificado: 'C:\\Users\\Admin\\.platformio\\penv\\lib\\site-packages\\platformio\\assets\\templates\\ide-projects'

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

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/index.html

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

============================================================"

After running “pip install -U platformio”:

Microsoft Windows [versão 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Todos os direitos reservados.

C:\Users\Admin>cd
C:\Users\Admin

C:\Users\Admin>cd C:\Users\Admin\.platformio\penv\Scripts

C:\Users\Admin\.platformio\penv\Scripts>platformio.exe --help
Error: Traceback (most recent call last):
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\platformio\__main__.py", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1054, in main
    with self.make_context(prog_name, args, **extra) as ctx:
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 920, in make_context
    self.parse_args(ctx, args)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1613, in parse_args
    rest = super().parse_args(ctx, args)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1378, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 2360, in handle_parse_result
    value = self.process_value(ctx, value)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 2322, in process_value
    value = self.callback(ctx, self, value)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1273, in show_help
    echo(ctx.get_help(), color=ctx.color)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 699, in get_help
    return self.command.get_help(self)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1298, in get_help
    self.format_help(ctx, formatter)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1331, in format_help
    self.format_options(ctx, formatter)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1533, in format_options
    self.format_commands(ctx, formatter)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\click\core.py", line 1586, in format_commands
    cmd = self.get_command(ctx, subcommand)
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\platformio\cli.py", line 80, in get_command
    module = importlib.import_module(commands[cmd_name])
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\platformio\commands\ci.py", line 24, in <module>
    from platformio.project.commands.init import project_init_cmd, validate_boards
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\platformio\project\commands\init.py", line 55, in <module>
    @click.option("--ide", type=click.Choice(ProjectGenerator.get_supported_ides()))
  File "C:\Users\Admin\.platformio\penv\lib\site-packages\platformio\project\integration\generator.py", line 62, in get_supported_ides
    for name in os.listdir(tpls_dir)
FileNotFoundError: [WinError 3] O sistema não pode encontrar o caminho especificado: 'C:\\Users\\Admin\\.platformio\\penv\\lib\\site-packages\\platformio\\assets\\templates\\ide-projects'

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

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/index.html

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

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





After running "C:\Users\Admin\.platformio\penv\Scripts>pip install -U platformio":

"Requirement already satisfied: platformio in c:\users\admin\.platformio\penv\lib\site-packages (6.1.6a3)
Requirement already satisfied: pyelftools<1,>=0.27 in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (0.29)
Requirement already satisfied: starlette==0.22.* in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (0.22.0)
Requirement already satisfied: marshmallow==3.* in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (3.19.0)
Requirement already satisfied: aiofiles==22.1.* in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (22.1.0)
Requirement already satisfied: pyserial==3.5.* in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (3.5)
Requirement already satisfied: uvicorn==0.20.* in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (0.20.0)
Requirement already satisfied: click<9,>=8.0.4 in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (8.1.3)
Requirement already satisfied: colorama in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (0.4.6)
Requirement already satisfied: requests==2.* in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (2.28.1)
Requirement already satisfied: semantic-version==2.10.* in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (2.10.0)
Requirement already satisfied: bottle==0.12.* in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (0.12.23)
Requirement already satisfied: wsproto==1.2.* in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (1.2.0)
Requirement already satisfied: tabulate==0.9.* in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (0.9.0)
Requirement already satisfied: ajsonrpc==1.* in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (1.2.0)
Requirement already satisfied: zeroconf<1 in c:\users\admin\.platformio\penv\lib\site-packages (from platformio) (0.39.4)
Requirement already satisfied: packaging>=17.0 in c:\users\admin\.platformio\penv\lib\site-packages (from marshmallow==3.*->platformio) (21.3)
Requirement already satisfied: idna<4,>=2.5 in c:\users\admin\.platformio\penv\lib\site-packages (from requests==2.*->platformio) (3.4)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\users\admin\.platformio\penv\lib\site-packages (from requests==2.*->platformio) (2.1.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\admin\.platformio\penv\lib\site-packages (from requests==2.*->platformio) (1.26.12)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\admin\.platformio\penv\lib\site-packages (from requests==2.*->platformio) (2022.9.24)
Requirement already satisfied: typing-extensions>=3.10.0 in c:\users\admin\.platformio\penv\lib\site-packages (from starlette==0.22.*->platformio) (4.4.0)
Requirement already satisfied: anyio<5,>=3.4.0 in c:\users\admin\.platformio\penv\lib\site-packages (from starlette==0.22.*->platformio) (3.6.2)
Requirement already satisfied: h11>=0.8 in c:\users\admin\.platformio\penv\lib\site-packages (from uvicorn==0.20.*->platformio) (0.14.0)
Requirement already satisfied: async-timeout>=4.0.1 in c:\users\admin\.platformio\penv\lib\site-packages (from zeroconf<1->platformio) (4.0.2)
Requirement already satisfied: ifaddr>=0.1.7 in c:\users\admin\.platformio\penv\lib\site-packages (from zeroconf<1->platformio) (0.2.0)
Requirement already satisfied: sniffio>=1.1 in c:\users\admin\.platformio\penv\lib\site-packages (from anyio<5,>=3.4.0->starlette==0.22.*->platformio) (1.3.0)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\admin\.platformio\penv\lib\site-packages (from packaging>=17.0->marshmallow==3.*->platformio) (3.0.9)"

The location of the templates for the IDEs were recently altered in Made assets (templates, "99-platformio-udev.rules") part of Python’s … · platformio/platformio-core@bf7fb15 · GitHub. Could this cause this issue? CC @ivankravets

1 Like

Sorry for the issue, fixed in the latest development branch. Please re-run pio upgrade --dev.

Hi!

Finally, I have PlatformIO working again.
I could not say if some of the things I did thru all these days contributed or not. A lot of tries, indeed.

Right now, I’ve Python 3.8.7 installed, as a replacement of the previous 3.8.9 version, one of the tries in a chase in the dark to (try to) solve the problem.

Was this problem caused by something present in my PC and/or was that due some PlatformIO issue present in a recent update?

Anyway, thanks a lot to @maxgerhardt and @ivankravets