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?

AndyRoid
  • 5,062
  • 8
  • 38
  • 73

3 Answers3

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
Benoit Lacherez
  • 506
  • 2
  • 8
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.

AndyRoid
  • 5,062
  • 8
  • 38
  • 73
  • That's fine. However this env variable won't remain. As you told it , you should set it in bash_profile. – Benoit Lacherez May 23 '15 at 21:46
  • 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 people – AndyRoid May 23 '15 at 21:47
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'
Ali80
  • 6,333
  • 2
  • 43
  • 33