[SOLVED] Failed to install PlatformIO

Version: 1.39.2 (user setup)
Commit: 6ab598523be7a800d7f3eb4d92d7ab9a66069390
Date: 2019-10-15T15:35:18.241Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.16299

When I open VScode it says it is installing platformIO, but stops and creates an error.

Installing PlatformIO Core...
Please do not close this window and do not open other folders until this process is completed.
Failed to install PlatformIO IDE.
Error: Could not create PIO Core Virtual Environment. Please create it manually -> http://bit.ly/pio-core-virtualenv 
 Error: Virtualenv Create: Traceback (most recent call last):
  File "C:\Users\MaxG\.platformio\.cache\tmp-1076D4Xshk23RyPW\virtualenv-16.7.5\virtualenv.py", line 2632, in <module>
  File "C:\Users\MaxG\.platformio\.cache\tmp-1076D4Xshk23RyPW\virtualenv-16.7.5\virtualenv.py", line 870, in main
  File "C:\Users\MaxG\.platformio\.cache\tmp-1076D4Xshk23RyPW\virtualenv-16.7.5\virtualenv.py", line 1156, in create_environment
    install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages=site_packages, clear=clear, symlink=symlink)
  File "C:\Users\MaxG\.platformio\.cache\tmp-1076D4Xshk23RyPW\virtualenv-16.7.5\virtualenv.py", line 1526, in install_python
    shutil.copyfile(executable, py_executable)
  File "D:\Prog\Python37\lib\shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\MaxG\\.platformio\\penv\\Scripts\\python.exe'

Using base prefix 'D:\\Prog\\Python37'
New python executable in C:\Users\MaxG\.platformio\penv\Scripts\python.exe

	at t.value (c:\Users\MaxG\.vscode\extensions\platformio.platformio-ide-1.9.2\node_modules\platformio-node-helpers\dist\index.js:1:32251)

When I click on ‘report a problem’ I get a 500 error on Git.

Now what? All was working fine until it wants to update itself.
It has updated itself in the past, but not this time.

I deleted the .platformIO directory, and installed platformIO again; now all is working.

This VSCode PlatformIO extension update (1.9.1/1.9.2) was a pretty major one… where the version of the python environment used for PlatformIO jumped from 2.x to 3.x … so some breakage is happening on the transition with some system. Since you’re past that things should be fine again now :wink: