Atom: 1.15.0 x64 Linux
Platformio: IDE 2.0.0-beta.2 路 Core 3.4.0a4
Steps to reproduce:
-> Press Serial Monitor
-> Select any port and baud rate
-> The following error occurs
pio device monitor --port /dev/ttyS0 --filter colorize --eol LF --echo
[me@laptop Directory] pio device monitor --port /dev/ttyS0 --filter colorize --eol LF --echo
bash: pio: command not found
(Build and Upload steps work fine though).
I am also seeing the same issue.
Atom: 1.15.0 x64 OSX
Platformio: IDE 2.0.0-beta.2.3 路 Core 3.4.0a4
It also looks like when I open a Terminal the same bash: pio: command not found error occurs.
There seems to be a work around: https://github.com/platformio/platformio-atom-ide/issues/47#issuecomment-192302365
The path is different for the beta versions: Menu: PlatformIO > Settings > PlatformIO IDE Terminal > Auto Run Command and specify it to export PATH=export PATH=~/.platformio/penv/bin:$PATH
@tehnorm thanks for sharing this workaround, it helps.
The problem is linked with customized .bash_profile. Please check that you don't override PATH variable. You need to keep previous value of PATH. For example, use
export PATH="/cusotm/paths:${PATH}"
instead of
export PATH="/cusotm/paths"
Hmm, I don't actually override the PATH variable in bashrc or bash_profile.
In bashrc I simply have: export PATH=$PATH:'/home/sandro/.gem/ruby/2.3.0/bin'
And this is my acual path variable:
echo $PATH
/home/user/.gem/ruby/2.4.0/bin:/home/user/.gem/ruby/2.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/share/java/basex/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/user/.gem/ruby/2.3.0/bin
Documented in http://docs.platformio.org/en/latest/faq.html#platformio-is-not-recognized-as-an-internal-or-external-command
Why closing? The problem is not resolved, as stated in my comment on April 9th
@kalsan what is your shell?
Thanks @ivankravets
I'm using bash on login. Sometimes I use fish, but it's unrelated to atom / platformio activities.
@kalsan what is your default shell? Could you check Fish initial configuration? Somewhere you override global $PATH.
When / how does platformio extend the PATH variable? Perhaps I can try to debug it this way.
@kalsan could you try this solution?
When / how does platformio extend the PATH variable? Perhaps I can try to debug it this way.
PIO IDE extends PATH with a path to PIO Core before starting a terminal instance. If you override PATH in your shell scripts, you will not see PIO Core here. You can try manually to make a few echo $PATH in different places.
@kalsan could you try this solution?
My shell is already bash:
user@machine ~> echo $SHELL
/bin/bash
user@machine ~> sudo chsh -s /bin/bash user
[sudo] Passwort f眉r user:
Shell f眉r user 盲ndern.
chsh: Shell nicht ge盲ndert.
(Translation: "chsh: shell not changed")
I just installed the latest PlatformIO update. It didn't help.
This is what attempting to open a serial monitor looks like without the workaround linked by @tehnorm :
pio聽device聽monitor聽--port聽/dev/ttyS1聽--filter聽colorize聽--eol聽LF聽--echo
[user@machine聽bitthief]$聽pio聽device聽monitor聽--port聽/dev/ttyS1聽--filter聽colorize聽--eol聽LF聽--echo
bash:聽pio:聽command聽not聽found
[user@machine聽bitthief]$聽echo聽$PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/share/java/basex/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr
/bin/core_perl:/home/user/.gem/ruby/2.3.0/bin
[user@machine聽bitthief]$
This is what happens if I apply the workaround:
export PATH=export PATH=~/.platformio/penv/bin:$PATH
pio聽device聽monitor聽--port聽/dev/ttyS1聽--filter聽colorize聽--eol聽LF聽--echo
[user@machine聽bitthief]$聽export聽PATH=export聽PATH=~/.platformio/penv/bin:$PATH
[user@machine聽bitthief]$聽pio聽device聽monitor聽--port聽/dev/ttyS1聽--filter聽colorize聽--eol聽LF聽--echo
---聽Miniterm聽on聽/dev/ttyS1聽聽9600,8,N,1聽---
---聽Quit:聽Ctrl+C聽|聽Menu:聽Ctrl+T聽|聽Help:聽Ctrl+T聽followed聽by聽Ctrl+H聽---
聽
---聽exit聽---
[user@machine聽bitthief]$聽echo聽$PATH
/home/user/.platformio/penv/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/share/java/basex/bin:/usr/lib/jvm/default/bin:/opt/opencascade/bin:/usr/bin/s
ite_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/user/.gem/ruby/2.3.0/bin
[user@machine聽bitthief]$
(Translation: "chsh: shell not changed")
You said that you have a fish shell, try to change to it and back to bash:
Could you place this export PATH=~/.platformio/penv/bin:$PATH in your bash profile?
@ivankravets here's a log of the experiments I did following your suggestions:
1. Changing shell
/usr/bin/fish2. Adding the penv path to .bashrc
The second option would be an acceptable workaround for me, since it survives pio updates (unlike the previous export workaround). If you are satisfied with this solution as well, the issue can be closed in my opinion. However if you'd like to investigate further to get more insights and maybe find a potential bug, I'll be happy to assist.
Issue still exists in 2.0.0-rc2
Issue still exists in 2.0.0-rc4
Running Manjaro (Arch)
Fixed with: export PATH=export PATH=~/.platformio/penv/bin:$PATH added to ~/.bashrc
I have the same problem (just installed PlatformIO on macOS). When opening the serial monitor I get:
pio device monitor --port /dev/cu.SLAB_USBtoUART --baud 115200
Boriss-Air:RobotArm borisbrock$ pio device monitor --port /dev/cu.SLAB_USBtoUART --baud 115200
bash: pio: command not found
Any updates? I still can't work on my project because of this :-(
Does the use of the export command not work for you?
@VanKurt do you use a custom shell?
No, I don't use a custom shell.
To be honest I don't know what "~/.bashrc" is and how to add anything to it. So I didn't try the export command...
@VanKurt
Please provide an output from a system Terminal
echo $PATH
echo $PYTHONPATH
python --version
pip --version
pip list
Hi,
here's what I get:
Boriss-Air:~ boris$ echo $PATH
/Library/Frameworks/Python.framework/Versions/3.4/bin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/tools:/platform-tools
Boriss-Air:~ boris$ echo $PYTHONPATHBoriss-Air:~ boris$ python --version
Python 2.7.10
Boriss-Air:~ boris$ pip --version
-bash: pip: command not found
Boriss-Air:~ boris$ pip list
-bash: pip: command not found
Could you try PlatformIO IDE for VSCode? Do you have the same issue?
I also had this problem on a fresh install of Manjaro Linux (based on Arch). I did no customization wrt PATH. Compiling and programming works fine but serial monitor doesn't find pio. For me the soultion was to set Settings->Platform IO Terminal->Login shell to false. Probably somewhere in the systemwide config the path is overwritten for login shells.
Same problem with MX Linux, I did what 'herm' did and now it is working fine.
Hi,
For fix it, please make a symlink of pio to /bin
sudo ln -s /home/daniel/.platformio/penv/bin/pio /bin/pio
Works perfect.
Regards
Setup bashrc path
echo "export PATH=~/.platformio/penv/bin:$PATH" >> ~/.bashrc
source .bashrc
Now test
cd my-platformio-project
pio run -t uploadfs
We have just released a new version 2.7.0, please upgrade.
Please note that we HIGHLY recommend moving to PlatformIO IDE for VSCode which resolves tons of issues and brings a lot of new features.
Most helpful comment
I also had this problem on a fresh install of Manjaro Linux (based on Arch). I did no customization wrt PATH. Compiling and programming works fine but serial monitor doesn't find pio. For me the soultion was to set Settings->Platform IO Terminal->Login shell to false. Probably somewhere in the systemwide config the path is overwritten for login shells.