2017-04-04 57 views
2

我有2.7.13在MacOS塞拉利昂和我試圖通過嘗試安裝python3但終端不斷出現的蟒蛇2.7.13

brew install python3 

一切都升級到python3好像也很順利,除了最後部分:

==> Installing python3 
==> Downloading https://homebrew.bintray.com/bottles/python3-3.6.1.sierra.bottle 
######################################################################## 100.0% 
==> Pouring python3-3.6.1.sierra.bottle.tar.gz 
==> Using the sandbox 
==> /usr/local/Cellar/python3/3.6.1/bin/python3 -s setup.py --no-user-cfg instal 
==> /usr/local/Cellar/python3/3.6.1/bin/python3 -s setup.py --no-user-cfg instal 
==> /usr/local/Cellar/python3/3.6.1/bin/python3 -s setup.py --no-user-cfg instal 
==> Caveats 
Pip, setuptools, and wheel have been installed. To update them 
    pip3 install --upgrade pip setuptools wheel 

You can install Python packages with 
    pip3 install <package> 

They will install into the site-package directory 
    /usr/local/lib/python3.6/site-packages 

See: http://docs.brew.sh/Homebrew-and-Python.html 
==> Summary 
    /usr/local/Cellar/python3/3.6.1: 3,600 files, 55.8MB 

我型後

python 

,我也得到

Python 2.7.13 (default, Dec 17 2016, 23:03:43) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 

我很新的編碼,所以任何幫助表示讚賞!

+0

@ParthapratimNeog它是不一樣的O.S. – Trimax

回答

5

Python 2.x和Python 3.x有不同的終端命令。

使用命令:python3使用Python 3.x的

同樣,使用pip3安裝Python模塊。


注:也嘗試學習virtualenv(虛擬環境),這樣就可以保持你的Python 2.x和Python 3.x都有環境中分離出來。

有很多教程可以做到這一點,例如this tutorial