Delfino
Delfino

Reputation: 567

Remove old Python Installation in MAC OS

I installed python using MacPort and I am satisfied with the result, but found that there are other versions of Python installed in other directories, and can not remember how they were instaldas, it's been five years that use this notebook and perhaps installed by other means a few years.

I tried to remove all references to extra Python, beyond that were installed with MacPorts, but do not think like, I tried to remove the directories with the command rm -rfmas even using sudo rm -rf have success.

The old instalation are in directories:

How to discover the origin of such facilities and remove permanently?

Upvotes: 0

Views: 1545

Answers (2)

eafit
eafit

Reputation: 468

Don't! The name /Library and /System suggest that they are OS-level directories. Nobody installed them. Instead, Mac and other linux-based systems use them by default for system-level services (and they should not be even manually upgraded or system stability may suffer).

For all what matters, you should just prepend your installation directory to a system variable called PATH in your $HOME/.bashrc file. Then, whenever YOU use python, the system will always search for the first occurrence of python on PATH, which is your python. Open terminal, enter the following command (once in a life time):

echo "PATH={a-path-to-the-folder-containing-your-executable-python}:\$PATH" >> $HOME/.bashrc

To explain it, the quoted command prepends your installation directory as the first place to search for executable files. The >> $HOME/.bashrc write this command to the last line of .bashrc, which is a file that setup your terminal environment automatically upon login.

Upvotes: 1

mipadi
mipadi

Reputation: 411250

Don't remove the system Pythons. They may be used by other programs. (I don't know if anything on OS X actually uses them, but it's best to keep them.)

Instead, just make sure that your MacPorts bin directory (at /opt/local/bin) is first on your $PATH.

Upvotes: 1

Related Questions