Path to shell executable "pio" is not a file of a symlink. - help please

Through google I was able to find one other instance of this error message, but for dotnet: Maybe this helps. .net - Visual Studio Code C# Debugging Problem (The terminal process failed to launch: Path to shell executable "dotnet" is not a file of a symlink.) - Stack Overflow

This looks like your $PATH is misconfigured, somehow.

In the VSCode PlatformIO extension settings, there’s also an option for a “custom PATH” – maybe you can use that.

Do you get anything back from this command:

whereis pio

That should list all the executable pio filenames on your system – well, on your PATH. Mine (Linux Mint 19.3) shows me this:

norman@Hubble:~$ whereis pio
pio: /usr/local/bin/pio /home/norman/.local/bin/pio

As you can see, I have two. Which one is at the top?

which pio

/home/norman/.local/bin/pio

Now, is it a file or a sym-link, or not?

ls -l /home/norman/.local/bin/pio

-rwxr-xr-x 1 norman norman 222 Oct 30 16:36 /home/norman/.local/bin/pio

So, at least in my terminal session, the highest pio on my PATH is an actual file. What kind of file?

file /home/norman/.local/bin/pio

/home/norman/.local/bin/pio: Python script, ASCII text executable

It might be interesting to see what your system comes back with, if anything. nce you have tried this out in a terminal session, do it all again in a VSCode “terminal->New Terminal” session and see if you get the same/different results.

Just a thought.

Cheers,
Norm.

Same result as norman has, my Ubuntu 20.04 LTS works perfectly fine

max@max-VirtualBox:~$ lsb_release  -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.1 LTS
Release:	20.04
Codename:	focal
max@max-VirtualBox:~$ pio --version
PlatformIO, version 5.0.2b5
max@max-VirtualBox:~$ which pio
/home/max/.local/bin/pio
max@max-VirtualBox:~$ ls -la $(which pio) 
-rwxrwxr-x 1 max max 218 Nov 14 19:11 /home/max/.local/bin/pio
max@max-VirtualBox:~$ head -n10 $(which pio)
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from platformio.__main__ import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

what do these commands show for you?

Have you seen a warning about bad using PlatformIO from the root? We don’t need system permissions. Please remove duplicated PlatformIO Core from your system and DO NOT INSTALL it manully. The latest stable version comes with PlatformIO IDE extrension.

oleg@bb3:~/pio/homie_lamp_cabinet_V5$ whereis pio
pio: /home/oleg/.platformio/penv/bin/pio
oleg@bb3:~/pio/homie_lamp_cabinet_V5$ which pio
/home/oleg/.platformio/penv/bin/pio
oleg@bb3:~/pio/homie_lamp_cabinet_V5$

already try’ed check it… - it’s “”

oleg@bb3:~/pio/homie_lamp_cabinet_V5$ whereis pio
pio: /home/oleg/.platformio/penv/bin/pio
oleg@bb3:~/pio/homie_lamp_cabinet_V5$ which pio
/home/oleg/.platformio/penv/bin/pio
oleg@bb3:~/pio/homie_lamp_cabinet_V5$ pio --version
PlatformIO, version 5.0.3
oleg@bb3:~/pio/homie_lamp_cabinet_V5$ ls -la $(which pio) 
-rwxrwxr-x 1 oleg oleg 240 ноя 14 20:28 /home/oleg/.platformio/penv/bin/pio
oleg@bb3:~/pio/homie_lamp_cabinet_V5$ head -n10 $(which pio)
#!/home/oleg/.platformio/penv/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from platformio.__main__ import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())
oleg@bb3:~/pio/homie_lamp_cabinet_V5$

removed all, all off platformio’s,vscode,.platformio and .vscode dir in home, reinstall vscode and add platformio as extension!
but have no success result :frowning:

different only in path
“/home/norman/.local/bin/pio” - work
“/home/oleg/.platformio/penv/bin/pio” in my case don’t work - but i install platformio via vscode extension install interface - what i do wrong?

oleg@bb3:~/pio/homie_lamp_cabinet_V5$ file /home/oleg/.platformio/penv/bin/pio
/home/oleg/.platformio/penv/bin/pio: Python script, ASCII text executable
oleg@bb3:~/pio/homie_lamp_cabinet_V5$ ls -l /home/oleg/.platformio/penv/bin/pio
-rwxrwxr-x 1 oleg oleg 240 ноя 15 16:37 /home/oleg/.platformio/penv/bin/pio
oleg@bb3:~/pio/homie_lamp_cabinet_V5$

Please try the next:

  1. Uninstall global PlatformIO Core (pip uninstall platformio or pip3 uninstall platformio).
  2. Remove ~/.platformio/penv folder (rm -rf ~/.platformio/penv)
  3. DO NOT USE SUDO. Run installer script Redirecting...

Now,

~/.platformio/penv/bin/pio system info

Not working for me, after last update of VSCode, and following your steps, I have:

~/.platformio/penv/bin/pio system info
--------------------------  -------------------------------------------
PlatformIO Core             5.0.3
Python                      3.7.3-final.0
System Type                 linux_x86_64
Platform                    Linux-4.19.0-10-amd64-x86_64-with-glibc2.28
File System Encoding        utf-8
Locale Encoding             UTF-8
PlatformIO Core Directory   /mnt/opt/platformio
PlatformIO Core Executable  /usr/local/bin/platformio
Python Executable           /home/avp/.platformio/penv/bin/python
Global Libraries            0
Development Platforms       10
Tools & Toolchains          32
--------------------------  -------------------------------------------

works fine via command line, but in the VSCode IDE I have:

> Executing task: pio run <

The terminal process failed to launch: Path to shell executable "pio" is not a file of a symlink.

Terminal will be reused by tasks, press any key to close it.

Indeed I tested on 1.50.1 with my screenshot above and it worked fine, but I’ve also just updated to 1.51.1 and still works perfectly fine there. All on Ubuntu 20.04 LTS.

grafik

$ pio system info
--------------------------  --------------------------------------------
PlatformIO Core             5.0.4a1
Python                      3.8.5-final.0
System Type                 linux_x86_64
Platform                    Linux-5.4.0-52-generic-x86_64-with-glibc2.29
File System Encoding        utf-8
Locale Encoding             UTF-8
PlatformIO Core Directory   /home/max/.platformio
PlatformIO Core Executable  /home/max/.local/bin/platformio
Python Executable           /usr/bin/python3
Global Libraries            0
Development Platforms       6
Tools & Toolchains          27
--------------------------  --------------------------------------------

If you feel confortable hacking around you may try to please VSCode’s error message by making pio an actual symlink.

In a PlatformIO core CLI, execute

which pio
# save output to clipboard
cat $(which pio) > ~/custom_pio
chmod +x ~/custom_pio
rm $(which pio)
ln -s ~/custom_pio path_from_which_pio_output
# should still go through
pio --version 

and restart VSCode and retry.

that’s not working too. For other side, I didn’t understand why you mentioned that I’m using hack version or custom version? I installed it from curl command like @ivankravets wrote.

Do you have custom shell in VSCode terminal?

mmm I’dont know, maybe:

I think that not, because my bash personalization is out of the IDE.

Ok, I fixed the issue. I don’t know but in the last version it not accept that you have directory in home called pio or a link symbolic with this name. In a old version of vscode that I tryed (1.46.1-1592428892), the message is clear: “pio is a directory”, in the last version the error message is “pio is not a file of a symlink”.

Is weird it because I have it many months ago, a directory pio for my all projects

oleg@3:~$ ~/.platformio/penv/bin/pio system info


PlatformIO Core 5.0.3
Python 3.8.5-final.0
System Type linux_x86_64
Platform Linux-5.4.0-53-generic-x86_64-with-glibc2.29
File System Encoding utf-8
Locale Encoding UTF-8
PlatformIO Core Directory /home/oleg/.platformio
PlatformIO Core Executable platformio
Python Executable /home/oleg/.platformio/penv/bin/python
Global Libraries 0
Development Platforms 2
Tools & Toolchains 9


oleg@3:~$

Maybe do you have in your path some directory with name pio ? I resolved the same issue that you have when I renamed my project directory pio to any name.

You RIGHT!!!
I have in home folder with name “pio” - before vscode 1.51 all work ok, but whe i update to 1.51 - it’s broken, and when i rename “pio” to “pio_” all work like a charm! Thank ALL for you help…