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

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…

Could someone explain to me what is going wrong? I’ve just spent time, installed clean Ubuntu 2020 in VirtualBox, followed Linux: 'apt-get install python3-venv' · Issue #85 · platformio/platformio-core-installer · GitHub and everything worked!

How to break it?

Have you also done mkdir ~/pio or mkdir -p ~/Documents/pio to reproduce that? Maybe @gorec2005 can say where exactly that folder was if I’m wrong?

Try to make folder in home path with “pio” name :slight_smile:
in my case (two host with ubuntu (home and work) have “pio” folder in home… and when i renamed it - all begin work correct.
oh one moment which i forget - ‘pio’ folder is folder where stored my project’s

ls -l ~

итого 1380
drwxr-xr-x 18 oleg root   4096 фев  9  2020 chaos_calmer
drwxr-xr-x  3 oleg oleg   4096 ноя 11 18:30 Desktop
drwxr-xr-x  4 oleg oleg   4096 авг  3 09:11 Documents
drwxr-xr-x 18 oleg oleg   4096 ноя 14 19:54 Downloads
-rw-rw-r--  1 oleg oleg 854434 ноя 14 20:27 get-platformio.py
drwxrwxr-x  2 oleg oleg   4096 июл 15 09:13 Grandstream GXP1610
drwxr-xr-x  3 root root   4096 окт 14 12:02 hisense
-rw-r--r--  1 oleg root   1650 сен 25  2019 interfaces
drwxr-xr-x  7 oleg root   4096 янв 31  2020 ipcam
drwxr-xr-x  2 oleg root   4096 фев  2  2020 ipv6
-rw-r--r--  1 oleg root    387 фев 14  2020 livingroom.yaml
drwx------  5 oleg oleg   4096 ноя  3  2019 _.local
-rw-r--r--  1 oleg oleg      0 янв  8  2020 log
-rwxr-xr-x  1 oleg root     70 июн 19 15:26 lylygo.enable
drwxr-xr-x  5 oleg root   4096 янв 25  2020 miio
drwxr-xr-x 11 oleg root   4096 сен 30 12:31 mikrotik
drwxrwxr-x  4 oleg oleg   4096 фев 10  2020 modbus
drwxr-xr-x  2 oleg oleg   4096 июл 24  2019 Music
drwxr-xr-x  2 oleg oleg   4096 ноя 14 01:31 Pictures
drwxr-xr-x 31 oleg root   4096 ноя 15 00:02 pio
drwxr-xr-x  2 oleg oleg   4096 июл 24  2019 Public
drwxr-xr-x  9 oleg oleg   4096 мая 22 23:31 snap
drwxr-xr-x  3 oleg root   4096 мар 16  2020 stm32
drwxrwxr-x  3 oleg oleg   4096 мар  7  2020 STM32Cube
drwxrwxr-x  3 oleg oleg   4096 апр 16  2020 STM32CubeIDE
drwxrwxr-x  2 oleg root   4096 мар  6  2020 Telegram
drwxr-xr-x  2 oleg oleg   4096 июл 24  2019 Templates
drwxr-xr-x  3 oleg oleg   4096 дек 27  2019 Videos
drwxrwxr-x  3 oleg oleg   4096 авг 15  2019 VirtualBox VMs

when i rename “pio” to “pio-projects” all begin work correct!

What was the reason to add HOME_DIR into the system PATH?

I did not do this special

$ set

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

i think - it’s standart… but trouble real - and only after update vscode to 1.51… before this update all work ok with ‘pio’ folder in home. and if i can help - just tell - i can get you ssh to my host for additional debug this situation…

Yes, we migrated to a short version of the PlatformIO Core CLI tool named pio. So, we normalized all our pages, including docs. The previous versions of the extension were calling the platformio command.

well, we know that, but I think that wasn’t the problem. After this update, for people that had /home/user/pio as workspace, vscode couldn’t build any project into this workspace, only by renaming the workspace “pio” to another one, vscode worked again.

i had very similar issue but with “platformio” command… folder “platformio” in ~ causes this issue too.

1 Like

yes, the error come back again, but in new format, now is with the directory “platformio” :neutral_face: before it was with “pio” directory…

I seem to have been trapped by the same thing. I got the error:

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

After renaming the folder home/<user>/Code/platformio/ the error was gone.

I tried various mentioned methods on my machine (Apple M1 macOS 13.4 Beta (22F5027f)), including reinstalling the PlatformIO extension and local installation of platformio, but nothing worked until I commented out the line from my .zshrc file (for which I don’t remember how it got there):

export PATH=$PATH:${HOME}/.platformio/penv/bin

Then it started to work again.