Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove python 2.7 from Mac OS X 10.14.5?

I realise that there is already an answer for the question but its for Mac OS X 10.6.4 and the python he installed was from "python.org". My python 2.7 has come built-in in my Mac so how do I remove it? Is there any way of removing it? I have installed a python3.7 from the website and it is working perfectly but 2.7 is also working. I want to remove 2.7 and make it such that when i type "python" in terminal it runs python3.7 and not 2.7.

like image 877
Nischaya Sharma Avatar asked Nov 29 '22 21:11

Nischaya Sharma


1 Answers

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

Do not remove python 2.7 (default python package), it may damage your operating system.

If you want you can simply use this command (removes the python installed with homebrew):

brew uninstall python

Refer this question if you really thinking of removing python 2.7. Here is another question which will give you more information.

like image 182
R4444 Avatar answered Dec 04 '22 15:12

R4444