user3727864
user3727864

Reputation: 41

change association for python files on mac terminal

I have the anaconda python install on my mac and I already set the path for it. When I type in python in the terminal, it opens the anaconda python as intended. But when I use a command like "./file.py", the original apple python is used. How can I change it so that it would run with anaconda python as well?

Upvotes: 0

Views: 98

Answers (1)

Steven Kryskalla
Steven Kryskalla

Reputation: 14669

What is the shebang at the top of the file?

If it's /usr/bin/python, it'll always use system python.

If it's /usr/bin/env python, it will use whichever python binary is highest on the PATH.

Upvotes: 2

Related Questions