简体   繁体   中英

Make python3 as my default python on Mac for Fish shell

Every time I type python into the console it uses Python 2.7. I would like it to use the latest version (I have it installed), Python 3.9. How do I do this using the fish shell (other StackOverFlow talks about for bash)?

First, look where it is installed:

ls -l /usr/local/bin/python*

note the line which ends with python3.9 without anything (as m for example) and type

ln -s -f /usr/local/bin/python3.9 /usr/local/bin/python

where '/usr/local/bin/python3.9' is what you have copied from above.

type in a new session

python --version

should be ok..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM