Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
1  
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
    
for redhat distros I recommend using yum to install python packages. if you are missing the package, then I would recommend an install via debian's package manager. – VenomFangs Sep 22 '15 at 22:07

You must log in to answer this question.

Browse other questions tagged .