简体   繁体   English

Python,M2 Mac 上的 Python,安装错误

[英]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.我一次又一次地收到此错误“zsh:找不到命令:python”。我无法朗读我的 python 代码。 How can I able to run my python Conde on my M2 Macpro 13"?我怎样才能在我的 M2 Macpro 13" 上运行我的 python Conde?

I tried "python3 --version" and I get "Python 3.11.0" But when I try "python --version", I gives "zsh: command not found: python"我尝试了“python3 --version”,得到了“Python 3.11.0”但是当我尝试“python --version”时,我给出了“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,由于 Python 2.7 和 Python 3.1 存在重大差异,因此它们与不同的命令一起使用以避免其他程序/依赖关系中断。

  • 'python' -> Python 2.7 “蟒蛇”-> Python 2.7
  • 'python3' -> Python 3 'python3' -> Python 3

You can set alias for python in.zshrc file可以在.zshrc文件中为python设置别名

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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