5
votes

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?

3
The pio bin is not in your $PATH probably - Benoit Lacherez
Thanks a lot this is all very helpful to the post /sarcasm - AndyRoid
@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? - AndyRoid
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 mac - AndyRoid

3 Answers

6
votes

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
2
votes

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.

0
votes

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'