[Mono-list] IronPython source file must be present to run on Linux

Ben Rousch brousch at gmail.com
Mon Apr 26 16:10:20 EDT 2010


On Mon, Apr 26, 2010 at 3:27 PM, Ben Rousch <brousch at gmail.com> wrote:
> I have a simple IronPython 2.6 Hello World console program created and
> compiled with SharpDevelop on Windows. You can download the program
> here: http://dl.dropbox.com/u/101667/HelloWorld.zip
>
> When I run the HelloWorld executable on Windows, it works correctly.
> When I run the same thing on Linux, it fails and says it can't find
> the HelloWorld module. If I put the HelloWorld.py script from which
> the executable was compiled into the directory with the executable,
> the script runs fine on Linux.
>
> I think SharpDevelop uses the standard pyc.exe to compile IronPython,
> but just in case I compiled it myself and got the same results.
>
> I also tried running the program under Mono 2.4 on Windows and it ran
> correctly without HelloWorld.py
>
> I can work around this problem by including the Python source, but I
> don't think that is the correct behavior.
>
> OS: Ubuntu 9.10
> Mono Version: Mono JIT compiler version 2.4.4 (Debian
> 2.4.4~svn151842-1gezakovacs~karmic1)
>
> Full error message when HelloWorld.py is not present:
> Unhandled Exception: IronPython.Runtime.Exceptions.ImportException: No
> module named HelloWorld
>  at IronPython.Modules.Builtin.__import__
> (IronPython.Runtime.CodeContext context, System.String name,
> System.Object globals, System.Object locals, System.Object fromlist,
> Int32 level) [0x00000]
>  at (wrapper managed-to-native)
> System.Reflection.MonoMethod:InternalInvoke
> (object,object[],System.Exception&)
>  at System.Reflection.MonoMethod.Invoke (System.Object obj,
> BindingFlags invokeAttr, System.Reflection.Binder binder,
> System.Object[] parameters, System.Globalization.CultureInfo culture)
> [0x00000]
>

I see the same seemingly incorrect behavior using Mono 2.6.3 on OpenSuse.

> --
>  Ben Rousch
>  brousch at gmail.com
>  http://ishmilok.blogspot.com/
>



-- 
  Ben Rousch
  brousch at gmail.com
  http://ishmilok.blogspot.com/


More information about the Mono-list mailing list