|   | 1 |  initial version  | 
You first need to import sage.all.
The following should work (I'm including version info for reference):
$ sage -v
SageMath version 8.1, Release Date: 2017-12-07
$ sage -python
Python 2.7.14 (default, Dec  9 2017, 17:25:34) 
[GCC 7.2.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sage.all
>>> from sage.rings.integer_ring import ZZ
>>>
|   | 2 |  No.2 Revision  | 
You first need to import sage.all.
The following should work (I'm including version info for reference):
$ sage -v
SageMath version 8.1, Release Date: 2017-12-07
$ sage -python
Python 2.7.14 (default, Dec  9 2017, 17:25:34) 
[GCC 7.2.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sage.all
>>> from sage.rings.integer_ring import ZZ
>>>
Edit: you could even directly import ZZ form sage.all:
$ sage -python 
Python 2.7.14 (default, Dec  9 2017, 17:25:34) 
[GCC 7.2.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sage.all import ZZ
>>>
|   | 3 |  No.3 Revision  | 
You first need to import sage.all.
The following should work (I'm including version info for reference):
$ sage -v
SageMath version 8.1, Release Date: 2017-12-07
$ sage -python
Python 2.7.14 (default, Dec  9 2017, 17:25:34) 
[GCC 7.2.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sage.all
>>> from sage.rings.integer_ring import ZZ
>>>
Edit: you could even directly import ZZ form sage.all:
$ sage -python 
Python 2.7.14 (default, Dec  9 2017, 17:25:34) 
[GCC 7.2.0] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sage.all import ZZ
>>>
References:
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.