[IronPython] IronPython.Runtime.Exceptions.ImportException: No module named System

Dino Viehland dinov at exchange.microsoft.com
Tue Aug 5 16:48:21 PDT 2008


You need to add the DLLs you want to be available for importing.  We used to add System/mscorlib for you but don't anymore.  I suggest doing yourScriptRuntime.LoadAssembly(typeof(System.Diagnostics.Debug).Assembly);

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa
Sent: Tuesday, August 05, 2008 4:46 PM
To: users at lists.ironpython.com
Subject: [IronPython] IronPython.Runtime.Exceptions.ImportException: No module named System


I am trying this code , and it is giving me this exception
"IronPython.Runtime.Exceptions.ImportException: No module named System"

input = _scriptEngine.CreateScriptSourceFromString (

@"import clr
from System import *
clr.AddReferenceToFile("ABC.dll')
", System.Scripting.SourceCodeKind.Statements);

input.Execute (defaultScope);

IronPython.Runtime.Exceptions.ImportException: No module named System

I think it is not able to find the location of System.dll. If it would be Py
1.1 i could do like this
_pyEngine.Sys.path.Add(path);

but how to do it in 2.0
--
View this message in context: http://www.nabble.com/IronPython.Runtime.Exceptions.ImportException%3A-No-module-named-System-tp18841986p18841986.html
Sent from the IronPython mailing list archive at Nabble.com.

_______________________________________________
Users mailing list
Users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Users mailing list