4

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).

3
  • Have you checked your .bash_profile? Commented Nov 3, 2015 at 21:40
  • Hi and thanks for your input. Actually I am using zsh but there is nothing in shell config files (both in user/system zshrc and basic). I believe there must be something more general (like the /etc/paths.d or the /etc/paths) but I may be missing something obvious. Commented Nov 3, 2015 at 22:03
  • this may be helpfull: stackoverflow.com/questions/4271494/… Commented Nov 4, 2015 at 8:49

3 Answers 3

17

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.

Sign up to request clarification or add additional context in comments.

1 Comment

1

I also had a similar output when running:

echo $PATH

Standard out-put result:

/Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin

The following sequence of steps solved the issue for me using zsh (macOS Big Sur Version 11.1)

cd /Users/JohnDoe

vim .zprofile

Remove the following PATH settings and save the file:

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

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

Refresh zsh profile from the users home directory:

source .zshrc

Check your work:

echo $PATH

Standard out-put result:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin

Comments

0

To remove python 3.5 from your mac try below command

cd /Library/Frameworks/Python.framework/Versions
sudo rm -rf 3.5 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.