Reputation: 87
I have used both the python installer and brew to try to install python 3.10 but version 3.9.12 shows up in terminal, even though python 3.10 can be seen in finder.
Upvotes: 2
Views: 5594
Reputation: 79901
Since you're on macos Monterey, you have to set your PATH
for your shell (zsh
unless you've made a default shell change):
For using Python 3.10 from the Installer
If you got Python 3.10 from the python.org installer, put a line like this in your ~/.zshrc
file:
# somewhere in your ~/.zshrc, probably near the bottom
export PATH="/Library/Frameworks/Python.framework/Versions/3.10/bin:${PATH}"
For Python 3.10 from homebrew
Similar to above, but a different path
# assuming you did "brew install [email protected]"
# in your ~/.zshrc, near the bottom
export PATH="$(brew --prefix [email protected])/bin:$PATH"
Regardless of which option you pick, open up a new terminal instance or run exec zsh
in an existing terminal and you should hopefully have the right python3 version running.
# In my own .zshrc, I did this...
# export PATH="$(brew --prefix [email protected])/bin:$PATH"
> exec zsh
> python3 -V
Python 3.10.5
Upvotes: 4
Reputation: 69
On windows the version of python can be specified by tacking on -versionNumber to your python terminal call
python -3.1
Upvotes: -1