Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to remove python2 from /usr/bin/.... folder

in Macbook Air M1 i had installed python mistakely version 2.7.16 but after even installed latest 3.9 version in terminal its shows always old version only i had removed from Library folder and also tried from anaconda too but nothing working now and its keep showing version 2.7.16 only after everything removed so how can i removed every python from my system


currently its shows in usr/bin/python

both versions 2 and 3


TIA

MacBook Air 13″, macOS 11.4

Posted on Jun 15, 2021 10:45 PM

Reply
Question marked as Best reply

Posted on Jun 15, 2021 11:28 PM

Hi,

You don't have to remove python 2.7. You can simply add the command as an alias (you can also add this in your ~/.bash_profile file):

alias python='python3.9'

You Should do not remove python2.7, default python package, it would damage your operating system.

If you want to remove python2.7, you can simply use following command, removes the python which is installed with homebrew:

brew uninstall python.


Similar questions

1 reply
Question marked as Best reply

Jun 15, 2021 11:28 PM in response to sujal86

Hi,

You don't have to remove python 2.7. You can simply add the command as an alias (you can also add this in your ~/.bash_profile file):

alias python='python3.9'

You Should do not remove python2.7, default python package, it would damage your operating system.

If you want to remove python2.7, you can simply use following command, removes the python which is installed with homebrew:

brew uninstall python.


How to remove python2 from /usr/bin/.... folder

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.