Problem with PlatformIO installation on VSCode

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…

The latest PlatformIO IDE 2.0 for VSCode comes with the new PlatformIO Core installer that contains portable Python. There is a problem with your system (permissions, antivirus, etc). Do you use any insecure software such as kaspersky, avast, macafee, etc?

I found may way here because it’s my 1st day using VSCode/PIO and I just have a habit of stepping right into whatever problems exist.

I tried installing a library using a PIO command while I was in a project workspace and it doesn’t exist. I have never installed Python on this machine.

I do however have Mcafee installed. I would have never thought that could be a problem. Do I need to exclude some directory (or something?).

Please keep in mind I don’t know VSCode/PIO like you do.

I saw another one of your posts where you mentioned a PIO backend Service but you didn’t include information about where or what it is that I need to whitelist in the firewall. Can you send me to a resource that explains this better?

Could you try to exclude %USER_HOME%/.platformio from your espionage tool that steals data from your machine?

1 Like

You’re pretty hilarious but who isn’t trying to steal our datas.

I’ll try that.

1 Like

I really appreciate you taking a minute to get me back on track.

You should know this

1 Like

Not me! :stuck_out_tongue:

It is quite annoying though when you install something, and the anti-malware/anti-virus/anti-make-my-computer-usable app decides to make its presence known (or not known, but the effects of it’s presence known)… and not in a good way. I used to have Bitdefender installed… it worked ok, but it was a bit too over-eager in silently blocking every single executable used to compile stuff, and get even more annoying when you changed boards or platforms, and had to go through one by one and unblock stuff as it blocked it.

1 Like

I actually cancelled MacAfee because their solution to exclude folders was “You can’t because we say so”. I’m a grown ass man and will take responsibility for what I do and own up to my own bad decisions because I’m a glutton for failure since it’s the only way I ever learn anything.

1 Like

Hello everybody here i just want to comment that yesterday 25-03-2021 i had the problem to install platformIO using Vscode. All i do is to dowload Python from Microsoft store but before that i erased the .platmormio folder C:/Users/user/.platformio and the other platformio folder inside vscode folder. So to read your comments helped me too much. Good luck.

Hi guys! I have a similar problem (using windows 10 pro) where when I try to install platformIO on visual studio code the home menu is not created and neither is the bottom menu bar. All that is done is that the bottom menu bar goes from purple to blue.

I also get a warning (only once per install) saying that “the extension ‘PlatformIO IDE’ took a very long time to complete its last operation and it has prevented other extensions from running.”

When “saving as” a file, it usually takes about 15-25 seconds which I think takes a lot of time. This is my first time using VSC so I don’t really know if this is normal or not.

When trying to open the platformIO home from the view->command palette->PlatformIO:Home I get this error message:

What I have tried:

Specs (I don’t know if relevant):
CPU: AMD Ryzen 7 3800X
GPU: GTX 960
RAM: 32GB DDR4 3200MHz

I appreciate any help I could get to figure this out and I wish I could attach more than 1 photo. Thanks!

Is there antivirus running that could interfere?

What folders regarding PlatformIO and VSCode are in a OneDrive?

What other extensions do you have installed in VSCode?

There are no anti-virus programs installed except the Windows Security.

New files I created and saved were located in the OneDrive. I have removed OneDrive from my computer. After removing it I’m now getting a new error message when I try to view->command palette->PlatformIO:Home, and the bottom menu no longer turns blue but stays purple:

I have only installed the C/C++ and the platformIO extensions.

Just want to update the status of my struggles with installing platformio.

I recently upgraded my GPU from a GTX960 to a RTX1080ti and I installed some new drivers from Nvidia. I tried to mine some bitcoins using my old GTX960 just for fun but my hardware was “incompatible” with the site I used (NiceHash), but it worked just fine with my new 1080ti. I figured I might go for a long shot and that maybe my GTX960 was “incompatible” with VSC or platformio, so I tried to install platformio with my new GPU, and it worked! I am using it with onedrive and with no changes to my firewall in windows.

I have no idea why it worked, but maybe some with more experience know?
Just wanted to put it out there in case someone else has the same issue with installing platformio on an older GPU.

I have this message which appears when installing PltformIO under VSCode.
The installation stops with the message: “Failed to install PlatformIO IDE”

Capture d’écran 2021-05-09 003625

I see the MicrosoftWindowsApps\python3.exe is in the error message there, therefor it’s pretty much guaranteed to be the issue as described and solved in Failed to Install PlatformIO v2.3.0 on VS Code v1.54.3.

Hello, in my case the problem was linked to my windows account, the account name had two names, the solution I had was to create a local admin user with administrator privileges and perform the configuration on that user. Worked perfectly!!

I had a similar issue yesterday. Today it is fixed somehow. I had tried uninstalling PlatformIO and deleting its folder in %userprofile% and reinstalling. Didn’t work. I then installed PySerial and pywin32 in the penv folder inside the platformio folder like this comment suggested: ImportError: DLL load failed: The specified module could not be found · Issue #586 · platformio/platformio-vscode-ide · GitHub
That also did not work so I uninstalled PIO from VSCode again and shut down my PC. Today when I started it back up and tried to install PIO it just worked.

Maybe this can help someone else ¯\(ツ)

tras una actualizacion forzada de windows, casi todo el archivo settings.json se me había borrado dejando solo las lineas que dicen “yalm.schemas”
no compile
no work
1 dia entero perdido buscando solucion
pero deje esto en el archivo Settings y trabaja

{

"platformio-ide.forceUploadAndMonitor": true,

"platformio-ide.disablePIOHomeStartup": true,

"platformio-ide.autoPreloadEnvTasks": true,

"platformio-ide.autoRebuildAutocompleteIndex": true,

"platformio-ide.autoOpenPlatformIOIniFile": true,

"platformio-ide.autoCloseSerialMonitor": true,

"platformio-ide.useBuiltinPIOCore": true,

"redhat.telemetry.enabled": false,

"platformio-ide.activateProjectOnTextEditorChange": true,

"platformio-ide.buildTask": "PlatformIO: Build",

"platformio-ide.customPATH": "C:\\Users\\USERX\\AppData\\Local\\Programs\\Microsoft VS Code\\bin",

"platformio-ide.disableToolbar": false,

"platformio-ide.useBuiltinPython": false,

"platformio-ide.customPyPiIndexUrl": "https://pypi.org/simple",

"yaml.schemas": {

    "file:///c%3A/Users/desarrollo01.DT2LABS/.vscode/extensions/atlassian.atlascode-2.9.1/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml"

}

}

For my case, it was making sure the effective firewall profile was all PRIVATE.
I have 4 connections on my machine, only one used, the others were connected to like another machine directly or something, It was not a defined network- so in my Firewall info page it said PRIVATE (active) PUBLIC (active). In other words both were applied.

How I fixed this is a bit out there, but make sure that you are on a PRIVATE network, or that the firewall settings are compatible.

I created Exceptions to Platformio.exe and pio.exe to allow. I created a loopback exception (conns to and from 127.0.0.0-127.255.255.255) are allowed.

Neither of those fixed it.

my specific error in the console was

mainThreadExtensionService.ts:64 RequestError: connect ECONNREFUSED 127.0.0.1:8011
	at ClientRequest.<anonymous> (c:\Users\andyt\.vscode\extensions\platformio.platformio-ide-2.4.0\node_modules\got\dist\source\core\index.js:956:111)
	at Object.onceWrapper (events.js:422:26)
	at ClientRequest.emit (events.js:327:22)
	at ClientRequest.EventEmitter.emit (domain.js:467:12)
	at ClientRequest.origin.emit (c:\Users\andyt\.vscode\extensions\platformio.platformio-ide-2.4.0\node_modules\@szmarczak\http-timer\dist\source\index.js:39:20)
	at Socket.socketErrorListener (_http_client.js:469:9)
	at Socket.emit (events.js:315:20)
	at Socket.EventEmitter.emit (domain.js:467:12)
	at emitErrorNT (internal/streams/destroy.js:106:8)
	at emitErrorCloseNT (internal/streams/destroy.js:74:3)
	at processTicksAndRejections (internal/process/task_queues.js:80:21)
	at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)

Expanding the errors with the dropdown shows the traceback:

_doInvokeHandler	@	rpcProtocol.ts:472
_invokeHandler	@	rpcProtocol.ts:457
_receiveRequest	@	rpcProtocol.ts:373
_receiveOneMessage	@	rpcProtocol.ts:295
(anonymous)	@	rpcProtocol.ts:160
fire	@	event.ts:577
fire	@	ipc.net.ts:513
_receiveMessage	@	ipc.net.ts:871
(anonymous)	@	ipc.net.ts:710
fire	@	event.ts:577
acceptChunk	@	ipc.net.ts:286
(anonymous)	@	ipc.net.ts:247
k	@	ipc.net.ts:50
emit	@	events.js:315
addChunk	@	internal/streams/readable.js:309
readableAddChunk	@	internal/streams/readable.js:284
Readable.push	@	internal/streams/readable.js:223
onStreamRead	@	internal/stream_base_commons.js:188

Since RPC Features prominently in the call stack, I also allowed more of the RPC (Remote Procedure Call) related exceptions through the firewall, though ONLY on Private (e.g. on my home network- I could open it up everywhere, but its not really safe)

After tweaking the firewall, and then making sure the PRIVATE was the only active profile- the network I was connected to was defined as private, and the null connection was manually defined (169.254.x.x) and also declared PRIVATE.
This took off the PUBLIC firewall exceptions (block anything not specficially allowed) and allowed it to connect once again.

This issue has been plaguing me repeatedly for a few years now. And for me at least, I found the source- if one of the connections triggers a PUBLIC firewall policy- maybe wifi turns on, etc.) then nothing worked.

I tried all the other things, reinstalling (10x over the years) Python, path etc. And it was intermittent so really difficult to catch the source.

1 Like