2017-08-29 103 views
0

我剛剛安裝了python 3.6.2。 然後我打開了Mac終端和類型:我無法在mac上找到python

python3 -V 

,它說:「找不到命令」

我再變目錄到桌面,並重復同樣的命令,它給了相同的結果。然後我想:

type -a python 

,它說:蟒蛇:找不到

+0

內置版本在安裝之前是否工作? –

+0

您是如何安裝它的? –

+0

我去了蟒蛇主網站,現在我可以看到它位於我的應用程序。但是,當我在Mac終端鍵入python它說python:命令未找到 – John

回答

1

你應該蟒蛇可執行文件的路徑首先添加到環境變量$ PATH,那麼你就可以無論你運行該命令是。

在你的終端:

touch ~/.bash_profile; open ~/.bash_profile 
export PATH="path-to-your-python-folder:$PATH" 
save it and exit (Command + Q) 
force execute it with: source ~/.bash_profile 

重新啓動系統,那麼你應該能夠運行它。

相關問題