Fix Python 2.7 issue on OSX: bad interpreter
written on Wed Apr 18 2018 00:00:00 GMT+0000 (Coordinated Universal Time)Share “
by Christian FeiShare “
Share “
Today I encountered an issue with Ansible and my python installation.Share “
The error was the following:Share “
/usr/local/bin/ansible-playbook: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory
I tried reinstall python@2, linking the python installation again with brew link python, also unlinking and linking it again brew unlink python; brew link python.Share “
And the most hilarious thing is that I had python2.7 install:Share “
$ which python
/usr/local/bin/python
The only workaround I found to work for me, was to create a symbolic link to satisfy the path Ansible was expecting:Share “
ln -s /usr/local/bin/python /usr/local/opt/python/bin/python2.7
Hope this helps 🙂