Question: Python version change I use a MacBook version 12.1 I want to change the python version terminal -(base) hyeyunpark@Hy-Mac ~ % python --version Python 3.9.7

Python version change

I use a MacBook version 12.1

I want to change the python version

terminal -(base) hyeyunpark@Hy-Mac ~ % python --version

Python 3.9.7

(base) hyeyunpark@Hyeyuns-Mac ~ %

I deleted /Library/Frameworks/Python.framework/Versions/3.9 (now only have Library/Frameworks/Python.framework/Versions/3.10)

and when I used the python10 keyword, it showed

terminal -

(base) hyeyunpark@Hyeyuns-Mac ~ % python3.10 --version

Python 3.10.9

(base) hyeyunpark@Hyeyuns-Mac ~ % ln -s /usr/local/bin/python3.10 /usr/local/bin/python

ln: /usr/local/bin/python: File exists

(base) hyeyunpark@Hyeyuns-Mac ~ % python3.10 --version

Python 3.10.9

(base) hyeyunpark@Hyeyuns-Mac ~ % /usr/local/bin/python3.10 --version

Python 3.10.10

(base) hyeyunpark@Hyeyuns-Mac ~ % echo $PATH

/opt/anaconda3/bin:/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin

(base) hyeyunpark@Hyeyuns-Mac ~ % export PATH="/usr/local/bin:$PATH"

(base) hyeyunpark@Hyeyuns-Mac ~ % python --version

Python 3.9.7

(base) hyeyunpark@Hyeyuns-Mac ~ %

I want to change Python 3.10.9

what is the problem ??

I got answer from here-

It seems like you have created a symbolic link from /usr/local/bin/python3.10 to /usr/local/bin/python, but the existing /usr/local/bin/python file is still pointing to the old Python version (3.9.7). You can try running the following command to overwrite the /usr/local/bin/python file with the symbolic link to Python 3.10.9: sudo ln -sf /usr/local/bin/python3.10 /usr/local/bin/python This command will create a new symbolic link to Python 3.10.9 and replace the existing /usr/local/bin/python file. After running this command, you can check the Python version by running python --version again. It should show Python 3.10.9.

but it is not working

correct comment please

Last login: Sun Feb 26 16:53:52 on ttys002

(base) hyeyunpark@Hyeyuns-Mac ~ % sudo ln -sf /usr/local/bin/python3.10 /usr/local/bin/python

Password:

Sorry, try again.

Password:

(base) hyeyunpark@Hyeyuns-Mac ~ % python --version

Python 3.9.7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!