DNB*_*ims 7 python macos development-environment
我在OS X上下载了python 3.2,我安装在我的硬盘上.但问题是,当我去终端时,我输入python...它仍然显示如下的旧版本:
Python 2.6.1(r261:67515,2010年6月24日,21:47:49)[GCC 4.2.1(Apple Inc. build 5646)]关于darwin类型"帮助","版权","信用"或"许可"欲获得更多信息.
然后,我去python下的文件夹,我发现这样的文件:
更新Shell Profile.command
所以,我运行它,它显示类似的东西
/Applications/Python\ 3.2/Update\ Shell\ Profile.command ; exit;
Users-MacBook:~ User$ /Applications/Python\ 3.2/Update\ Shell\ Profile.command ; exit;
This script will update your shell profile when the 'bin' directory
of python is not early enough of the PATH of your shell.
These changes will be effective only in shell windows that you open
after running this script.
All right, you're a python lover already
logout
[Process compleUser]
Run Code Online (Sandbox Code Playgroud)
但是我仍然无法在终端中获得python 3.2.我做错什么了吗?谢谢.
在您的终端中,键入python3.
在unix like system上,python 2.x通常是系统使用的默认python版本.但是python 2和python 3之间的语言语法发生了巨大的变化,使得2不兼容.因此,你不能在你的系统上用python 3替换python 2,否则你可能会彻底破坏一些基本的系统包.
所以python 3解释器通过python3命令可用来区分旧的python 2解释器.
| 归档时间: |
|
| 查看次数: |
1991 次 |
| 最近记录: |