简体   繁体   中英

Python , Python on M2 Mac, Installation error

can anyone help me whats the problem in it. I get this error again and again "zsh: command not found: python".I was not able to rum my python code. How can I able to run my python Conde on my M2 Macpro 13"?

I tried "python3 --version" and I get "Python 3.11.0" But when I try "python --version", I gives "zsh: command not found: python"

'python' command was originally used for Python 2.7 and since there was a major difference in Python 2.7 and Python 3.1, they were used with different commands to avoid other programs / dependencies breaking.

  • 'python' -> Python 2.7
  • 'python3' -> Python 3

You can set alias for python in.zshrc file

echo "alias python='python3'" >> ~/.zshrc

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