platformio / platformio-core

Your Gateway to Embedded Software Development Excellence :alien:
https://platformio.org
Apache License 2.0
7.98k stars 800 forks source link

Clion: PlatformIO utility is not found but installed #3744

Open danielroehrig opened 4 years ago

danielroehrig commented 4 years ago

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

ivankravets commented 4 years ago

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?

danielroehrig commented 4 years ago

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

wirwolf commented 2 years ago

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

ivankravets commented 2 years ago

@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.

wirwolf commented 2 years ago

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

ivankravets commented 2 years ago

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

UtechtDustin commented 2 years ago

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
smarteist commented 1 year ago

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
EasyG0ing1 commented 1 year ago

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!

cgursche commented 1 year ago

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.

ivankravets commented 1 year ago

@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