无法在Mac上运行python

无法在Mac上运行python,python,terminal,installation,pip,Python,Terminal,Installation,Pip,我对python相当陌生。我确实在学习过程中。我知道这听起来很愚蠢,但任何帮助都将被感激。 我只在终端上键入python,出现以下错误: NameError: name 'python' is not defined SyntaxError: invalid syntax 我想安装或卸载软件包。我键入了pip安装matplotlib 我得到了这个错误: NameError: name 'python' is not defined SyntaxError: invalid syntax

我对python相当陌生。我确实在学习过程中。我知道这听起来很愚蠢,但任何帮助都将被感激。 我只在终端上键入python,出现以下错误:

NameError: name 'python' is not defined
SyntaxError: invalid syntax
我想安装或卸载软件包。我键入了pip安装matplotlib 我得到了这个错误:

NameError: name 'python' is not defined
SyntaxError: invalid syntax

非常感谢

看起来您试图在python解释器中而不是在命令提示符下运行python

$ python
Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> python
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'python' is not defined
>>> pip install matplotlib
  File "<stdin>", line 1
    pip install matplotlib
              ^
SyntaxError: invalid syntax

键入quit或Ctrl+D退出python解释器,然后您可以进行pip安装,等等

这与编程python无关,但要在Mac上安装python,您已经启动了解释器您已经在运行python-您需要退出才能返回终端!