Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am new to Python. I wanted to try out the itertools package from Python. But I got the error:

NameError: global name 'itertools' is not defined

How to resolve this error? Do I need to install this module? I have included from itertools import *.

How to install this module? Where do I find the itertools module/package? I searched on google but it kept referring to documentation page of itertools.

I am using Debian 6. I have Python 2.6.

share|improve this question
I've just installed Debian 6.0.8 in a VM, the default python then is 2.6.6. And I could just 'import itertools' without any problem. Which exact debian version and python version are you using? –  brm Dec 31 '13 at 10:17
@brm I tried import itertools instead of from itertools import * and it worked fine. Any idea why this is so? –  Tem Pora Dec 31 '13 at 10:56
No idea. Both work just fine here –  brm Dec 31 '13 at 10:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.