Import error for collections

Dec 7, 2009 at 12:23 PM

Hi, I'm new to this and would appreciate some help.

I am having a problem with importing the collections module, the error reads "ImportError: No module named collections"

Googling revealed that the collections module was added in v. 2.4

However I am using IronPython 2.6, so that should be in order, and doing an import in the console works fine.

So that leads me to think that perhaps this has something to do with the DLR. I'm using v. 0.92.

If anyone could point me in the right direction, I would appreciate it.


Dec 7, 2009 at 2:26 PM

When embedding IronPython, the Python standard library isn't automatically in your path. You need to add it with ScriptEngine.SetSearchPaths.

Dec 8, 2009 at 1:31 PM

Yup, that's it. Thanks Curt