簡體   English   中英

如何在Mac上使用python 3.X做好准備?

[英]How to get ready using python 3.X on Mac?

我在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]

但是我仍然無法在終端中獲得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解釋器。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM