Changing python by default in OSX Mountain Lion

I installed Python via MacPorts and then changed the path to this.

/opt/local/bin/python

using this command

sudo port select python python27

But now I want to go back to the Mac along the way

/usr/bin/python

How can i do this?

EDIT:

I uninstalled MacPort Python, restarted the terminal, and everything returned to normal. It’s strange. But I do not know why and how.

+4
source share
2 answers

The sudo port select command only switches what /usr/local/bin/python indicates, and does not touch the path /usr/bin/python at all.

The /usr/bin/python executable is still the default Apple installation. Your $PATH variable may still look in /usr/local/bin before /usr/bin , but when you type python at the terminal command line.

+2
source

Try

 sudo port select python python27-apple 

You can use port select --list python to display all versions of python available through ports.

+1
source

Source: https://habr.com/ru/post/1434155/


All Articles