"-bash: python2: command not found" on OS X

10,248

Solution 1

Maybe you could try do define an alias. It seems that python2 is hardcoded somewhere in the script.

You could try (just an example):

alias python2="python2.7"

and then run the script -- hope that helps.

Kind regards, Julian

Solution 2

I confirmed it works on macOS. I installed Python 2.7 and 3.5 using brew commands:

brew update
brew install python
brew install python3
Share:
10,248
Admin
Author by

Admin

Updated on June 11, 2022

Comments

  • Admin
    Admin almost 2 years

    I'm trying to use this script to import my iTunes library to another program.

    At the step where I enter python2 export_to_quod_libet.py, I'm getting an error message that says that the python2 command can't be found. I figured out through python -v that I definitely have Python 2.7 installed, so I'm really confused about this.

    I did find a similar question being asked here, but the original poster was using Windows (whereas I'm using OS X El Capitan), so a lot of what was said at least didn't seem applicable to my situation.

    Could someone tell me what I'm doing wrong, please?

  • killthrush
    killthrush over 4 years
    This was a good suggestion for me, as I prefer to use a pyenv installed version rather than system python