Skip to content Skip to sidebar Skip to footer

Problems With The Python Version On Macos Bigsur

I have a problem with the python version. I downloaded and installed the latest version of python directly from the site, 3.9.0, but when I check the version from the terminal usin

Solution 1:

[edit] (thanks to @JohnVargo) Big Sur uses zsh by default, therefore you must amend the .zprofile i/o the .bash_profile. ...Unless you changed the default to use bash, then do as follows: [/edit]


If you want to use python to launch python3 from the command line, you can go to your home directory and edit your ~/.bash_profile by adding the following lines:

in terminal type $ which python this will return the path to the system python2 interpreter; let's call this path_to_p2

in terminal type $ which python3 this will return the path to the system python3 interpreter; let's call this path_to_p3

export PATH=path_to_p3:$PATHalias python3=path_to_p3
alias python=path_to_p3

export PATH=path_to_p2:$PATHalias python2=path_to_p2

save, relaunch terminal; You can now launch python3 with either python, or python3, and python2 with python2

Solution 2:

This is because macOS uses python 2 by default. So run your commands with python3 Then it'll only use python 3.

enter image description here

Post a Comment for "Problems With The Python Version On Macos Bigsur"