Search code examples
pythonmacososx-elcapitan

Remove installed Python 3.5 from Mac Os X global path


I have recently installed the "official" Python 3.5 on Mac Os X (El Capitan). During this installation, Python changes the global path to include /Library/Frameworks/Python.framework/Versions/3.5/bin (this can be seen using for instance /usr/libexec/path_helper).

However, I am unable to understand where this "set" is done (there is nothing nor in /etc/paths neither in /etc/paths.d). I would like to remove this entry from the global path (without removing the installation itself because it can be always useful).


Solution

  • I have got the same issue. After a SUPER LONG search I found this file: "~/.zprofile". Check within this file and you will find the following code:

    # Setting PATH for Python 3.5
    # The original version is saved in .zprofile.pysave
    PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
    export PATH

    Just remove this code and save the file.