PredictionIO: Pio command not found after install
Asked Answered
P

3

5

I am guessing that somehow PredictionIO didn't setup the path variables properly.

I used method 2 to install PredictionIO from this link here: PredictionIO

Everything installed correctly but when I typed in pio it says command not found. This is what I see:

enter image description here

When I try to start pio from finder I get this:

enter image description here

enter image description here

Kind of lost, what am I doing wrong here?

Ponytail answered 23/5, 2015 at 20:30 Comment(4)
The pio bin is not in your $PATH probablyLekishalela
Thanks a lot this is all very helpful to the post /sarcasmPonytail
@BenoitLacherez I am new to mac, porting over from Windows. I'm not sure but from my understanding I would use an export command to add to it to my existing bash_profile?Ponytail
And I don't believe the question is off topic, something like this would be helpful to anyone just getting predictionIO who is also new to macPonytail
L
6

The solution is to edit your PATH environment variable. You can do it directly in the shell:

$ export PATH=/Users/yourname/PredictionIO/bin:$PATH

However it will be set only as long as the session lasts. To make it permanent, you have to edit your bash profile file. I don't know how it is called on MacOS. On my Ubuntu, it is the .profile file. It is usually .profile, or .bash_profile or something like that.

$PATH is probably set in this file, so find where and edit.

My .profile file has a part in it that reads:

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:/opt/java/jdk1.8.0_45/bin:$PATH"
fi

I would change it to (even though it looks weird because it mixes your MacOS path and my Ubuntu ones):

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:/opt/java/jdk1.8.0_45/bin:/Users/yourname/PredictionIO/bin:$PATH"
fi
Lekishalela answered 23/5, 2015 at 22:2 Comment(0)
P
2

To get this working I simply did the following, this is for Mac Yosemite users.

$ PATH=$PATH:/Users/yourname/PredictionIO/bin; export PATH

Assuming you installed PredictionIO in that specific directory

Sidenote: I really don't like that there is so much cynicism to beginner's / semi-beginner's in certain areas it really makes me question StackOverFlow.

Ponytail answered 23/5, 2015 at 21:22 Comment(2)
That's fine. However this env variable won't remain. As you told it , you should set it in bash_profile.Lekishalela
If you write out a better answer, I will accept it. Also if you could explain in your answer why your answer is better that would be awesome too, not just for me but other peoplePonytail
S
0

pio uses its own python version, using your system's python can cause problems, you can define an alias in .zshrc file

alias pio='~/.platformio/penv/bin/python3 ~/.platformio/penv/bin/pio'
Spiegel answered 28/12, 2021 at 11:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.