Problem with PlatformIO installation on VSCode

Thanks, fixed! Please open PlatformIO IDE Terminal and type pio update or VSCode > Left Sidebar > PlatformIO > Update…

1 Like

Hi,
Would you mind show me (screenshot) where I can Update platformIO,
Both in terminal (in my terminal there is no pio in the env path).
Will you update the fixed version of platformIO on the VSCode website too.
Thanks in advance

There is a terminal icon on the bottom toolbar

26

1 Like

I have the same problem. New Windows 10 laptop, nothing else of relevance installed.
Tried to install, uninstall, reinstall, and delete .platformio folders many times.
I installed latest python (3.8.1, installs 32bit) and made sure it’s in the PATH.
PlatformIO installs correctly, “alien” icon shows up, but no commands in toolbar nor on left box (see picture)

command palette shows commands (e.g. “build”) but when I select it from command palette, I get error “command ‘platformio-ide.build’ not found” (see pic for “alien”, platformio versions, lack of icons / commands and error in lower right)
I’ll check the debug console but maybe someone can already tell me where to look … thanks

Error: Error: Command failed: global --encode-path " " -f "c:\Users\Massi\Dropbox\___STARTUPS_VARIE\CODE\PlatformIO\CheckPins\src\main.cpp"'global' is not recognized as an internal or external command,
operable program or batch file.
 `global --encode-path " " -f "c:\Users\Massi\Dropbox\___STARTUPS_VARIE\CODE\PlatformIO\CheckPins\src\main.cpp"` (exited with error code 1)

ok, what seemed to solve for now is this (I have all my platformio projects in a dir that is synced among computers via dropbox). I am used to open the containing folder as a workspace, as it worked on my old laptop. Like this.

WORKSPACE_FOLDER\PlatformIO_proj1
WORKSPACE_FOLDER\PlatformIO_proj2
...

and so on. so opening WORKSPACE_FOLDER as either a workspace or a folder works on old laptop but not on new one.

This does not work on new laptop. Both laptops are running same sw version of everything, but there must have been something that made the difference. Maybe because in the old laptop i “grew” my project dir and workspace one at a time?

anyway, by doing what was suggested here, I managed to get platformio to work for now.

  1. open just one of the projects as a folder e.g. WORKSPACE_FOLDER\PlatformIO_prj1. PlatformIO commands should be available now.
  2. add all other project folders inside WORKSPACE_FOLDER as extra folders. so far, if I try to include WORKSPACE_FOLDER itself, PlatformIO will stop working again.

Hope this helps in troubleshooting / making a future better user experience

1 Like

You need to open PlatformIO Project per workspace. Extension looks for platormio.ini file in the root of project folder.

4 Likes

You can’t open the WORKSPACE_FOLDER directly for multi-root projects. You need to do what you did… open one of them, and then add all the remainder, which you should be able to do in one hit, since you can either drag them all into the file explorer panel, or multi-select in the Add Folder To Workspace... dialog.

By opening the WORKSPACE_FOLDER directly, VSCode doesn’t treat it as multiple independent projects/folders, hence why it doesn’t work, and why the PlatformIO extension doesn’t see the requisite platformio.ini in the root of the folder.

1 Like

@ivankravets @pfeerick thanks!

1 Like

Hey mates, I am trying to install platformio on my vscode and I am getting this error, “PlatformIO: Can not find working Python 2.7 or 3.5+ Interpreter. Please install the latest Python 3 and restart VSCode” I did what the message suggests, I did try in many ways with no luck.
could you please give me a hand?.

Was one of the ways downloading Download Python | Python.org, adding it to the PATH (option during the installer) and restarting the computer?

Thanks for your reply, I did it.

  • I pressed the button I have Python and gave it the path.
  • I uninstall python and Install again check the box for include the path.
    nothing change.

Uninstall the PlatformIO VSCode extension and make sure that when you open a shell (Windows + R -> cmd.exe), python --version returns your installed Python 3 version. If that’s not the case, reboot your computer; If it’s still not there, then python is not in your PATH and you should reinstall it or fix your path. When you can successfully execute python3 the plugin installation should go through.

If there are still problems we need more details on your OS and how you installed VSCode. I’m assuming Windows here.

I did what you suggest, I have Python installed and there are still problems with the extension.

3.8.6rc1 is a bleeding edge release candidate. Have you tried with the latest stable 3.8.5?

Yes I did, and the error still there.

On which VSCode version is this?

8

this message appears after the extension can not find python.exe, even putting the full path to the python.exe

TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received type undefined
at validateString (internal/validators.js:112:11)
at Object.dirname (path.js:583:5)
at t.value (c:\Users\Davis.vscode\extensions\platformio.platformio-ide-2.1.0\node_modules\platformio-node-helpers\dist\index.js:1:29951)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async t.value (c:\Users\Davis.vscode\extensions\platformio.platformio-ide-2.1.0\node_modules\platformio-node-helpers\dist\index.js:1:27882)
at async t.default.install (c:\Users\Davis.vscode\extensions\platformio.platformio-ide-2.1.0\dist\extension.js:1:23075)
at async c:\Users\Davis.vscode\exte…