2013-11-27 108 views
1

我正在嘗試從版本2.7.3更新到版本3.3.3我已經從download page安裝它,使用Mac OS X 64位/ 32位安裝程序(3.3。 3)適用於Mac OS X 10.6及更高版本。我已經成功安裝了它,在我的應用程序中有一個Python 3.3文件夾,並且一切似乎都很好。唯一的問題是,當我輸入Python不能正確更新

python 

到終端,還在說

Last login: Wed Nov 27 12:20:07 on ttys000 
Computer:~ user$ python 
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> 

我已經執行了「更新殼輪廓Profile.command」也許50次,並顯示

Last login: Wed Nov 27 12:19:44 on ttys000 
Julian:~ julianmontague$ /Applications/Python\ 3.3/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. 
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 completed] 

我不記得它顯示的是什麼,但它顯示了類似的東西,而不是其他的東西,而不是「好的,你已經是蟒蛇愛好者了」。

我已經從我的應用程序文件夾中刪除了Python 2.7文件夾,我已經從usr/local/bin /中刪除了其中有2.7個東西的一些東西,我已經重新啓動了我的電腦,但它仍然說我有2.7 0.3。

+0

嘗試'python3'或'python3.3'。 – jazzpi

回答

2

你需要在終端中使python 3.3成爲默認的python版本。

拳頭,你需要到Python到正確的地方:

sudo rm -R /System/Library/Frameworks/Python.framework/Versions/3.3 
sudo mv /Library/Frameworks/Python.framework/Versions/3.3 /System/Library/Frameworks/Python.framework/Versions 

那麼你需要修復組和更新的鏈接:

sudo chown -R root:wheel /System/Library/Frameworks/Python.framework/Versions/3.3 
sudo rm /System/Library/Frameworks/Python.framework/Versions/Current 
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3 /System/Library/Frameworks/Python.framework/Versions/Current 

,那麼你需要解決,因爲pythonw等/usr/bin/是沒有鏈接,但在/usr/bin通過刪除舊的副本:

sudo rm /usr/bin/pydoc 
sudo rm /usr/bin/python 
sudo rm /usr/bin/pythonw 
sudo rm /usr/bin/python-config 

,然後您需要修復CURRENT版本鏈接:

sudo rm /System/Library/Frameworks/Python.framework/Versions/3.3/bin/pydoc 
sudo rm /System/Library/Frameworks/Python.framework/Versions/3.3/bin/python 
sudo rm /System/Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw 
sudo rm /System/Library/Frameworks/Python.framework/Versions/3.3/bin/python-config 

sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3/bin/pydoc3 /usr/bin/pydoc 
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3/bin/python3 /usr/bin/python 
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3 /usr/bin/pythonw 
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/3.3/bin/python3-config /usr/bin/python-config 
+0

出於某種原因,當我鍵入python時,它仍然表示版本2.7.3,但是當我編輯.bash_profile文件並添加了PATH =「/ path/to/your/python2.7/bin:$ {PATH}」時,導出PATH 它工作正常 – WD40