繁体   English   中英

我为Mac下载了Python,看来我有两个版本的Python?

[英]I downloaded Python for Mac and it seems that I have two versions of Python?

当我打开我的终端时, python --versionpython3 --version工作。 我的Mac上有两次吗? MAC OS X 是否预装了 Python? 我的 pyCharm IDE 如何知道要使用“哪个” Python?

这可能只是意味着您拥有两个版本的 python。 不同的程序可以由不同的版本运行,这意味着您可以使用它们中的任何一个来运行程序或创建自己的程序。 至于解释器,您可以选择自己要使用的版本。 希望这个链接有帮助: https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html#add_new_project_interpreter

我的Mac上有两次吗?

是的。 Python 2 和 Python 3 有很大不同,并且并行开发了很多年。 The time of Python 2 has come to an end , but some programs are still not ported to Python 3. Unless you are using a library that is only available on Python 2 (and there should not be many of those any more), you should仅使用 Python 3。

MAC OS X 是否预装了 Python?

是的。

我的 pyCharm IDE 如何知道要使用“哪个” Python?

PyCharm 文档上有一个页面

MacOS 的大部分(如果不是全部)都安装了python2 ,并且操作系统的某些部分仍然依赖它(Automator 工具、 xattr命令等)。

从 Catalina 开始, python3也已安装(嗯,作为一个存根,提示您安装命令行开发人员工具,其中包括它)。

尽管 Apple 在 Catalina 中的开发说明中说,诸如此类的脚本语言将从未来的版本中删除。

当然,您也可以从https://python.org或其他方法安装更多的 python。

暂无
暂无

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

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