Issue
Pretty much as far as i know i can't use or find a higher version of python in my terminal even though I have installed version 3.12.2.
![And this image is of applications folder that shows 3.12] (https://i.stack.imgur.com/GymaP.png)
I have tried uninstalling python completely then installing only 3.12.2 Yet it still only says 3.9.6. I have no idea whats up with it but if anyone can help I would greatly appreciate it.
Something I should also mention is that this started a day after I installed brew .
Solution
Because your PATH
environment has the path of your old python version, you have to manually configure it in PATH
in macos.
See the old python path and you will figure out how to get new python path and replace the old python path with new one.
Add below code to ~/.bash_profile
and then source it using source ~/.bash_profile
Use sudo nano ~/.bash_profile
in terminal to open an editor
then enter above code which is:
PYTHONPATH="/Library/Frameworks/Python.framework/Versions/3.9/bin/python3"
export PYTHONPATH
Python path on macos is like:
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
Change version of python to the one you have.
Then save it and close any opened terminal. Open terminal again and you should find the newest python version is in use.
Answered By - ali tarek
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.