NameError

Cai Gengyang gengyangcai at gmail.com
Thu Nov 24 10:05:17 EST 2016


CaiGengYangs-MacBook-Pro:~ CaiGengYang$ python
Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pygame
>>> "import pygame"
'import pygame'
>>> 











On Thursday, November 24, 2016 at 10:58:41 PM UTC+8, Thomas Nyberg wrote:
> On 11/24/2016 09:00 AM, Cai Gengyang wrote:
> > CaiGengYangs-MacBook-Pro:~ CaiGengYang$ import pygame
> > -bash: import: command not found
> 
> That indicates you're running "import pygame" at the bash interpreter 
> prompt. You should first start "python" (type the word python without 
> quotes and press enter) which starts the python interpreter. You should 
> see this: ">>>". After this, then type "import pygame". See if that works.
> 
> Cheers,
> Thomas




More information about the Python-list mailing list