platformio-core icon indicating copy to clipboard operation
platformio-core copied to clipboard

Clion: PlatformIO utility is not found but installed

Open danielroehrig opened this issue 5 years ago • 11 comments

Configuration

Operating system: Linux 5.9.8-2-MANJARO, Manjaro

PlatformIO Version (platformio --version): 5.0.3

Description of problem

image PlatformIO seems to be installed and in path and i can execute pio commands from any terminal, but clion refuses to recognize it.

Steps to Reproduce

  1. Install platform.io as described here
  2. Update path
  3. Try executing pio and see that it works
  4. Try creating a new PlatformIO project

Actual Results

Get the error message: PlatformIO utility is not found but installed

Expected Results

Set up new project

danielroehrig avatar Nov 22 '20 21:11 danielroehrig

It seems you run CLion from another shell (system) where PATH is not updated. Could you try to run CLion from a Terminal where you have access to pio --version?

ivankravets avatar Nov 23 '20 16:11 ivankravets

You were right. I needed to add the PlatformIO path to my .profile. Thanks for your help.

danielroehrig avatar Nov 23 '20 19:11 danielroehrig

Hello, @ivankravets. I have the same problem but I already added the path for the bin folder in PATH variable.

export PATH="$PATH:/home/wir_wolf/.platformio/penv/bin"

image image image

wirwolf avatar Feb 12 '22 09:02 wirwolf

@wirwolf could you leave "Path to PlatformIO Core CLI" input empty and launch CLion from the shell where platformio is visible?

It seems CLion starts from the shell where platformio is not avaialble.

ivankravets avatar Feb 12 '22 13:02 ivankravets

If Path to PlatformIO Core CLI input is empty i can not create a new project using PlatformIO. On the platform, I see an empty area. image

wirwolf avatar Feb 14 '22 08:02 wirwolf

@elmot what is the mechanism for checking if "PlatformIO utility is not found"? Thanks.

ivankravets avatar Feb 14 '22 11:02 ivankravets

I run into the same issue (Ubuntu), is related to https://youtrack.jetbrains.com/issue/CPP-29187/Clion-and-PlatformIO-using-defaults-does-not-find-the-PIO-installation. Clion don't use the PATH Variable from .bashrc, as suggested in the issue i tried to start clion from cli but i don't fixed the issue for me.

The following workaround works fine for me (create symlinks instead of appending to the PATH)

ln -s ~/.platformio/penv/bin/platformio /home/<username>/.local/bin/platformio
ln -s ~/.platformio/penv/bin/pio /home/<username>/.local/bin/pio
ln -s ~/.platformio/penv/bin/piodebuggdb /home/<username>/.local/bin/piodebuggdb

UtechtDustin avatar Sep 25 '22 00:09 UtechtDustin

I run into the same issue (Ubuntu), is related to https://youtrack.jetbrains.com/issue/CPP-29187/Clion-and-PlatformIO-using-defaults-does-not-find-the-PIO-installation. Clion don't use the PATH Variable from .bashrc, as suggested in the issue i tried to start clion from cli but i don't fixed the issue for me.

The following workaround works fine for me (create symlinks instead of appending to the PATH)

ln -s ~/.platformio/penv/bin/platformio /home/<username>/.local/bin/platformio
ln -s ~/.platformio/penv/bin/pio /home/<username>/.local/bin/pio
ln -s ~/.platformio/penv/bin/piodebuggdb /home/<username>/.local/bin/piodebuggdb

It does the job:

mkdir -p $HOME/.local/bin/ && ln -s $HOME/.platformio/penv/bin/platformio $HOME/.local/bin/platformio && ln -s $HOME/.platformio/penv/bin/pio $HOME/.local/bin/pio && ln -s $HOME/.platformio/penv/bin/piodebuggdb $HOME/.local/bin/piodebuggdb

smarteist avatar Feb 04 '23 14:02 smarteist

Here's the complete steps to the workaround:

Make this folder ~/.local/bin

Run these commands:

ln -s ~/.platformio/penv/bin/platformio ~/.local/bin/platformio
ln -s ~/.platformio/penv/bin/pio ~/.local/bin/pio
ln -s ~/.platformio/penv/bin/piodebuggdb ~/.local/bin/piodebuggdb

Open CLion and in the PlatformIO settings, DELETE ALL THE TEXT in the field asking for the path.

Apply / OK

Open a new PlatformIO project ... TA DA!

EasyG0ing1 avatar Jul 28 '23 20:07 EasyG0ing1

In CLion 2023.2.2, opened a new project, selected platformIO, selected "settings" in "PlatformIO not found" dialog, erased whatever location I had put in earlier, used the folder button to navigate to /usr/local/bin where the alias to platformIO resides (used shift-command-. to reveal hidden folders), and that's when CLion took over and said "I got this". Now it works.

cgursche avatar Nov 13 '23 20:11 cgursche

@elmot, PlatformIO Core is installed to the ~/.platformio/penv/ folder when using the Installer Script. Could you look for pio.exe in this folder if it was not found in the default $PATH? The location of pio depends on the host OS:

Windows: %HOME_DIR%/.platformio/penv/Scripts/pio.exe Unix: ~/.platformio/penv/bin/pio

ivankravets avatar Nov 29 '23 12:11 ivankravets