Mac: How To Change Python 2.7 to Python 3

preview_player
Показать описание
In this video I am describing the precise way - how you can change the default Python 2.7 on Mac for Python 3.x - in my case it is Python 3.9 - and then change it back to Python 2.7 if necessary.

- by Vladimir Heinz

Enjoy my videos!

Chapters:

00:00 - Intro
00:08 - Explanation
00:39 - How to get version of your Python
00:52 - how to install brew
01:44 - check if brew works
01:49 - How to use brew to install python
02:51 - How to check the version of Python
02:58 - How to run Python3
03:22 - How to list all python versions / how to list all pythons
03:56 - How to make python3 the default python on your mac
04:20 - Checking if the switch of Python 2.7 to 3 works
04:29 - It could be necessary to uninstall Python3 and brew
04:44 - How to bring Python 2.7 back as default on your mac
05:10 - How to uninstall Python3
05:54 - How to uninstall brew from your mac
06:18 - Checking if brew was removed
06:48 - Finish
Рекомендации по теме
Комментарии
Автор

To make python3 the default version on your Mac, you can simply write :

alias python=python3

sengyuu
Автор

BINGO! Done. Needed terminal to shut down in the end for change to execute. Worth the time. Thank YOU SO much.

anuragsspacestation
Автор

Can someone help me plz (sos)? I am getting the error message of: ln: /usr/local/bin/python: Permission denied
How should I fix it?

lizachuyaozhang
Автор

Thanks for sharing, but you need to work on your delivery: the screen/font is very small, you are going too fast, and you left no link for all those commands. When you do something, put your heart and thinking into it.

a.newman
Автор

Doesn't work for me. I type ls -l /usr/local/bin/python* and it displays the same thing as on your computer. But following the second step (ln -s -f...) it does not work, still says 2.7.16....

Xzizia
Автор

while downloading brew, got error by saying "/bin/bash: -c: option requires an to do ?

prajakt
Автор

I keep getting permission denied when i try to change the default to the new python. How do I fix this?

adamvanhorn
Автор

Pueden cambiar la configuracion de Shell:
Ejecuten en terminal: nano ~/.bashrc
cierren terminal y vuelvan a ejecutarla, escriban. python --version ya deben mostrarsemla nueva versión. Espero les sirva

mdwilliamsbarrios
Автор

I think the issue is usr/local isnt created yet.. that is why we are getting this error, but not sure how to change the python directory to be there

paparedzy
Автор

why mine still shows 2.7 no matter what method I tried... :(

tianayee
Автор

Is it normal to take a lot of time to download Homebrew? my iternet are working normal and fast.

xpto_
Автор

Thanks, restart the terminal for the changes

chandrajitsatapathy
Автор

zsh: no matches found: /urs/local/bin/python* ? why this is coming ?

ashishmali
Автор

solo como dato para quien pueda servirle: puede cambiar a python3 colocando en la terminal lo siguiente despues de la flecha --> alias python = python3.11 (esto cambiará a python3 PERO volverá a 2.7 una vez cerrado)

lfg_o
Автор

it doesn't let me list the pythons, do you know why or how I can fix this?

khaledchawa
Автор

when i type"ln -s -f /usr/local/bin/python3.10 /usr/local/bin/python" it says Permission denied

atitsharma