diff --git a/doc/source/index.rst b/doc/source/index.rst
index 607186a3fc030dc3acf4110d9ac5e21e1e23f40b..92bdc7108328be62ed7ec37dce72063255614865 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -85,6 +85,7 @@ page.
 To read events from an existing device::
 
         import libevdev
+        import sys
 
         fd = open('/dev/input/event0', 'rb')
         d = libevdev.Device(fd)