Installation of PlatformIO in VS Code problem

I cannot get PlatformIO to do anything. I don’t get a home button in VS. I was able to get Pio Home to bring up a web page, but when I try to install PlatformIO Core, I get errors about a platformIO folder in my documents directory.

Yes, I did search through here and tried everything I could find. Nothing works.

My next step is to uninstall VS code and PlatformIO and try to reinstall everything as an Administrator to see if that works.

If that doesn’t work, I guess PlatformIO is not ready for prime time for me.

Help!

Monty

OK, I uninstalled and reinstalled, and I still get all kinds of errors. I even tried installing platformIO while VS Code was running as Admin. Still a no go.

Oh well, the old Arduino IDE works ok. I just thought I’d try this new platformIO thing, but it’s too buggy for me. How any of you got this to work is amazing.

Monty

You only have to install VS Code and the PlatformIO extension.
Everything else should be installed by PlatformIO.

Please show the error messages…

What is working in ArduinoIDE?

Please provide valuable infos!

OK, so immediately after installing PlatformIO, the VS Code displays a popup about “Reload the workspace for the settings change to take effect.” I hit that, and it reformats the page in Code, and then I get the pop-up again saying the same thing. I do that 5 or 6 times, but it keeps coming back, so I finally give up on that and close Code and reopen it. But still, there is nothing in the lower left corner of Code that shows a house or home button for platformIO. So I try going to the terminal and type ‘pio home’. That brings up a web page. There, I tried to import an Arduino project. So, I pick an old Arduino project, select Arduino Uno as the board, and then browse for the *.ino file and select import. I get an error about python.exe not being allowed to open a directory from Windows and I get popups on the webpage saying: Server error: {“type”:“FileNotFoundError”,“args”:[2,“The system cannot find the file specified”],“message”:“[WinError 2] The system cannot find the file specified: ‘d:\\Users\\mshaw\\Documents\\PlatformIO\\Projects’”

So then I try New Project, select a board, and I get a popup that says: Could not initialize project
Invalid params

Somewhere in all of this, I get error messages on the terminal window of Code that say:
Error: {‘type’: ‘FileNotFoundError’, ‘args’: (2, ‘The system cannot find the file specified’), ‘message’: “[WinError 2] The system cannot find the file specified: ‘d:\\Users\\mshaw\\Documents\\PlatformIO\\Projects’”}
Error: {‘type’: ‘FileNotFoundError’, ‘args’: (2, ‘The system cannot find the file specified’), ‘message’: “[WinError 2] The system cannot find the file specified: ‘d:\\Users\\mshaw\\Documents\\PlatformIO\\Projects’”}

Directories did not get created and files copied over at install time.

I have searched the forum and tried anything I could find (that is how I learned about pio home), but still, nothing works. I can’t follow the installation directions for PlatformIO because there is no home button for PlatformIO on the lower left corner of Code.

Can you help me get this installed? I wrote code for mainframes, UNIX boxes, and Windows machines for 38 years. I can handle command line stuff, and I know how to write installation processes in Windows with Powershell and/or msi.

My theory is that something is broken in the installation process of PlatformIO.

Monty

This is unclear. What geht’s reformatted?

Usually VS Code must be restarted after PlatformIO is installed.

The PlatformIO status bar only shows up if you open a valid PlatformIO-Project - means a directory with a valid platformio.ini in it.

But you can open the Home Tab by clicking the PlatformIO Icon / QUICK ACCESS / PIO Home / Open

Then force a reinstall:

  • close VS Code
  • delete the folder C:\Users\mshaw\.platformio
  • restart VS Code
  • wait until PlatformIO finished all tasks (reinstalling PlatformIO)

the web page gets redisplayed. And I have restarted VS Code after the install.

I will try this, but I have a question. Does this installation include installing Python? Because it is not in my PATH, and I can’t run Python from the command line.

Also what about the firewall problem with not allowing python to be accessed.

I will try another reinstallation of platformio. But I have little hope of it working since I have already done this 3+ times. I still assert that there is a bug in the PlatformIO installation process.

Monty

I think i remember PlatformIO will bring its own python installation.

What is “the firewall problem” ?

OK I tried the reinstall of platformio by deleting the .platformio directory and then installed it in Code. Shut Code down immediatly after the install, started Code up again, and I keep getting these popup that say:Reload the workspace for the settings change to take effect.

I select reload from the popup and it redisplays the web Code Welcome page and then I get another “reload” popup as before. This repeats forever. I gave up on it and I selected the alien in the side bar and now it is installing the platformio core. That finished and I shut down Code and restarted it.And I get the reload popup thing and it keeps repeating if I select reload.

Then I click on the platformio alien icon and select Create New Project, enter in a name select Arduino uno board and hit finish. I get a popup error in Code (Could not initialize project invalid params) and a popup from Windows saying that it prevented python.exe from accessing a folder.

So it is still messed up,.Can’t create a project so useless as a development platform.

I am wondering if this projectio vs extension has a place to report bugs because this installation process is very buggy.

Monty

I misspoke (mistyped). I think Defender is protecting some directory from being accessed by python.exe.

Do you have other VS Code extension installed?

Something on your computer must be blocking the process.
Maybe your firewall / antivirus program ?

Yes, I guess Defender might be the culprit. But why doesn’t the installation take care of this problem, whatever it is? When I was coding, this would be flagged as a bug for sure. The installation is supposed to make it so the thing is installed and usable. Not make me wander around the internet and search for answers. Or hit the forum to be told that it works for others, but I must have messed something up.

Sorry, but this installation process is broke; it is a bug

Monty.

Ok I think I got it installed.

Here is what I did:

  1. Remove PlatformIO from extensions in VS Code
  2. Uninstall VS Code
  3. Find and remove a bunch of files and directories with PlatformIO in their name - this should have been done by the uninstall of the extension. This is a bug.
  4. Go get the latest version of python from python.org and install it.
  5. go to windows defender and let python.exe access protected folders - I was able to find previous errors in defender and just clicked allow to let python have access.
  6. install VS Code
  7. install PlatformIO in VS Code
  8. watch it install/download
  9. create a new project - this gets the Core initialized etc again this should be part of the extension install.

And it now appears to be installed.

I think too many people already have python installed and that is part of my problem because I did not. Also that .platformio thing should be removed during uninstall. That’s another problem.

just my 2 cents
Monty

Reinstalling as Administrator could resolve permission issues. Worth trying!

Yes, I tried that. The problem is that I have the protected folders option turned on in Windows, Platformio will not install.

I don’t even know how to use Platformio for the Arduino. It is even more complex than the Arduino IDE, and I don’t need it. So I gave up. I got it installed, but there are too many error messages that I don’t think it is worth trying to get it to work right. I could never get it to import an existing project anyway.

I think I’ll stay with the Arduino IDE. It just works.

Monty