BlockDev
BlockDev

Reputation: 1

When switching to zsh shell on mac terminal from bash, how do you update the base python version?

Mac has recently updated its terminal shell to Zsh from bash. As a python programmer, I'd like to have a consistency in python versions across all the systems that includes terminals, & IDE.

On a bash shell, to update the python version in the terminal to 3.8.1, I had followed the below process

nano ~/.bash_profile

alias python=python3

ctrl + x

y

enter

This enabled me to update the python version from 2.7.6 to 3.8.1. However, repeating the same steps for zsh shell didn't work out. Tried a tweak of the above process, and somehow stuck with 3.7.3

steps followed

which python3 #Location of the python3.8.1 terminal command file is found. Installed it.

python --version #returned python 3.7.3

PS: I am an absolute beginner in python, so please consider that in your response. I hope i am not wasting your time.

Upvotes: 0

Views: 1797

Answers (1)

maddinek
maddinek

Reputation: 11

it is actually not recommendet to update the default Python executable system-wide because some applications are depending on it.

Although, you can use venv (virtual environment) or for using another version of Python within your ZSH you can also put an alias like python='python3' in your ~/.zsh_profile and source it.

Hope that helps.

Greetings

Upvotes: 1

Related Questions