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

Michael Foord fuzzyman at voidspace.org.uk
Wed Aug 6 03:13:14 PDT 2008


Dino Viehland wrote:
> 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);
>
>   

What is the reason for not adding System? It creates an incompatibility 
between scripts run with 'ipy.exe' and scripts executed in an embedded 
environment. It has also been a cause of several questions on this list...

Personally I can't see how it is useful to not add this by default, but 
maybe there is a reason?

Michael

> -----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
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>   


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/
http://www.trypython.org/
http://www.ironpython.info/
http://www.resolverhacks.net/
http://www.theotherdelia.co.uk/



More information about the Users mailing list