Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I uninstall python from OSX Leopard so that I can use the MacPorts version?

I want to use the macports version of python instead of the one that comes with Leopard.

like image 986
Joshua Avatar asked Sep 23 '08 02:09

Joshua


3 Answers

Don't. Apple ships various system utilities that rely on the system Python (and particularly the Python "framework" build); removing it will cause you problems.

Instead, modify your PATH environ variable in your ~/.bash_profile to put /opt/local/bin first.

like image 74
jacobian Avatar answered Oct 24 '22 01:10

jacobian


I have both installed:

$ which python
/usr/bin/python
$ which python2.5
/opt/local/bin/python2.5

I also added the following line to my .profile:

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
like image 38
Greg Hewgill Avatar answered Oct 24 '22 02:10

Greg Hewgill


Use the python_select port to switch python interpreters.

sudo port install python25
sudo port install python_select
sudo python_select python25

This will symlink /opt/local/bin/python to the selected version. Then export PATH as described above.

like image 20
bryan Avatar answered Oct 24 '22 02:10

bryan