If you find yourself getting the error message: Error: Detected a whitespace character in project paths then you have one of two options (that I know of):

  1. Create a new user profile with no whitespace in the name, and set up your entire development environment again (not cool).
  2. Change the install path of the platformio compilers.

Option 2 sounds a lot simpler on the face of it, but since the compilers typically live under your user profile, ec: C:\\Users\\Some Body\\ this is a bit more complex. The following can and may cause side effected depending on what programs you have installed on your computer, and I recommend only doing it if you are a really confident tinkerer.

Option 2:

Since the issue with the toolchain is often down to whitespace in the user path, you need to remap your user home directory to remove any whitespace characters. Apparently this is not recommended by Microsoft, so caution is advised:

  1. Log out of the affected user account
  2. Log in as a different Administrator account
  3. Rename the offending folder, for instance adding a dash: C:\\Users\\Some-Body\\
  4. Fire up regedit.exe
  5. Find the entry for the user account you want to change under HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\\<User SID>\\. You can find the \<User SID\> ahead of time, but it's easy to browse through to identify the right account from the ProfileImagePath shown
  6. Modify the ProfileImagePath to match whatever you set in C:\\Users\\Some-Body\\
  7. Log out of the administrative account and log back in to the user account you've been operating on. Note that the display name will not change, so you'll still be logging in to Some Body
  8. Uninstall VS Code, and re-install it. VS Code keeps a record of the install location and context menu entries and updates will be broken till it's re-installed - arguably a small price to pay for not having to create an entire new user account!