WARNING: Building wheel for platformio failed: [WinError 3] The system cannot find the path specified: 'x:\\'

Python 3.9.10
Windows 10
VS Code : VSCode-win32-x64-1.78.0
Platformio : 3.1.1

Just trying to do a fresh install with VS Code on windows 10. It fails withh message

Collecting sniffio>=1.1 (from anyio<5,>=3.4.0->starlette==0.23.*->platformio)
** Downloading sniffio-1.3.0-py3-none-any.whl (10 kB)**
Building wheels for collected packages: platformio
** WARNING: Building wheel for platformio failed: [WinError 3] The system cannot find the path specified: ‘x:\’**
Failed to build platformio
ERROR: Could not build wheels for platformio, which is required to install pyproject.toml-based projects
WARNING: There was an error checking the latest version of pip.

To repeat

  1. From a 3.10.9 WinPy cmd shell with python and pip in path run code.exe from a fresh unzip of VSCode - the local version (not using the windows installer) - get the error above (and below) - I can run python from VS Code terminal, and pip etc.

Tried

  1. Deleteing all VS Code and uninstalling all others
  2. Deleting folder c:/users/username/.platformio
  3. Cant see anywhere on path or env vars that has a ‘x:\’ - so dont know where this is coming from - note that I may have had an X partition at some point in the past, but it doesnt exist now.

Building wheels for collected packages: platformio
** WARNING: Building wheel for platformio failed: [WinError 3] The system cannot find the path specified: ‘x:\’**
Failed to build platformio
ERROR: Could not build wheels for platformio, which is required to install pyproject.toml-based projects
WARNING: There was an error checking the latest version of pip.

PlatformIO is supposed to install its own isolated Python environment without requiring a preinstalled python. Can you only start code.exe directly, not from a WinPy command shell, and try installing the PlatformIO extension in there?

Hi,
So I run the code.exe staright from the window explorer (not the WinPython terminal), and the same error

Error: WARNING: Building wheel for platformio failed: [WinError 3] The system cannot find the path specified: ‘x:\’ ERROR: Could not build wheels for platformio, which is required to install pyproject.toml-based projects WARNING: There was an error checking the latest version of pip. Error: Could not install PlatformIO Core: If you have antivirus/firewall/defender software in a system, try to disable it for a while. Command ‘[‘C:\Users\marcu\.platformio\penv\Scripts\python.exe’, ‘-m’, ‘pip’, ‘install’, ‘-U’, ‘platformio’]’ returned non-zero exit status 1. → Installer version: 1.1.2 Platform: Windows-10 Python version: 3.

Note that if platformio requires its own virtual/python env then it will need a python in the path in the first place in order to create a python env, unless it also installs its own version of python first and then creates a python env from its own python version. I do not have any python in my path (as I dont want to use a system python in windows), so there is no pip or python in the path.

This is why I was running code from a win python cmd shell before in my original post, as I wasnt running code.exe from an already activated virtual python environment I just had win python in the path, so platformio should have been able to create its own python env from the win python on my path - again, unless it requires it own python installation.

Can you uninstall the PlatformIO VSCode extension, close VSCode, delete the whole C:\User\<user>\.platformio\ folder, reopen VSCode, reinstall the VSCode extension?

Same error - Do I need to have a System python installed and on the path before running VS Code ? Does platformio use python, in order to install its own python venv ?

This is from the Help->Toggel Developer Tools->Console

workbench.desktop.main.js:sourcemap:2272 [[object Object]]PlatformIO Core is not installed
workbench.desktop.main.js:sourcemap:2272 Error: PlatformIO Core is not installed
at O (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:6713)
at M (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:6811)
at A.value (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:808249)
at A.value (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:813593)
at A.value (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:813947)
at B.switchToProject (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\dist\extension.js:1:36815)
at new B (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\dist\extension.js:1:35816)
at Object.activate (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\dist\extension.js:1:41070)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
workbench.desktop.main.js:sourcemap:86 [Extension Host] rejected promise not handled within 1 second: Error: PlatformIO Core is not installed
workbench.desktop.main.js:sourcemap:86 [Extension Host] stack trace: Error: PlatformIO Core is not installed
at O (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:6713)
at L (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:7114)
at BA.host (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:10522)
at new Promise ()
at BA (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:10397)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Module.dA (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:10112)
at async E.getWebviewContent (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\dist\extension.js:1:4567)
at async E.newPanel (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\dist\extension.js:1:4035)
at async E.toggle (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\dist\extension.js:1:3594)
at async o._executeContributedCommand (u:\vscode\VSCode-win32-x64-1.69.0\EmbeddedC++\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:85:62863)
workbench.desktop.main.js:sourcemap:2272 [[object Object]]PlatformIO Core is not installed
workbench.desktop.main.js:sourcemap:2272 Error: PlatformIO Core is not installed
at O (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:6713)
at L (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:7114)
at BA.host (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:10522)
at new Promise ()
at BA (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:10397)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Module.dA (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:10112)
at async E.getWebviewContent (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\dist\extension.js:1:4567)
at async E.newPanel (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\dist\extension.js:1:4035)
at async E.toggle (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\dist\extension.js:1:3594)
at async o._executeContributedCommand (u:\vscode\VSCode-win32-x64-1.69.0\EmbeddedC++\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:85:62863)
workbench.desktop.main.js:sourcemap:86 [Extension Host] Error: PlatformIO Core is not installed
at O (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:6713)
at M (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:6811)
at A.value (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:816517)
at A.value (c:\Users\marcu.vscode\extensions\platformio.platformio-ide-3.1.1-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:816173)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)

I found the problem, I had a dangling link for pip - so basically I sued mklink in windows to link my pip folder to a different drive - I didnt want it all on my C drive - but then I had moved the destination of the link so it was pointing at nothing. This meant pip was missing.

Thanks for all the help with this.

BTW - VS code supports installing from a zip file, so you can have multiple copies with different extensions etc. You just need to make sure you have a data folder in the VSCode install folder. If platformio has a centralized user/.platformio folder, then how can a user have 2 different versions of it installed on the same PC ? Is that supported ?

Yes, you can have core_dir specified per-project in the platformio.ini or an enviornment variable PLATFORMIO_CORE_DIR, this will be used then instead if <user folder>/.platformio.

https://docs.platformio.org/en/latest/envvars.html#envvar-PLATFORMIO_CORE_DIR