2017-08-29 97 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 

重新启动系统,那么你应该能够运行它。

相关问题