I am not sure whether this should be expected to work or not, nor if I am using this correctly...<br><br>I tried to generate a standalone exe for a tool I have (3 modules) but it bombs out at startup with:<br><br>Unhandled Exception: IronPython.Runtime.Exceptions.ImportException: No module named os<br>
at DLRCachedCode.__main__$1(CodeContext $globalContext, FunctionCode $functionCode)<br> at IronPython.Compiler.OnDiskScriptCode.Run()<br> at IronPython.Runtime.PythonContext.InitializeModule(String fileName, ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options)<br>
at IronPython.Runtime.ModuleLoader.load_module(CodeContext context, String fullName)<br> at Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame frame)<br> at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)<br>
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)<br><br>I can reproduce with this simple foo.py module<br><br># foo.py<br>import os<br>print "Hello"<br>
print "OS:",<a href="http://os.name">os.name</a><br>print "Bye"<br>#end foo.py<br><br>which I compile with the following:<br><br> ipy -m pyc /standalone /main:foo.py /target:exe /out:foo<br>or<br> ipy -m pyc /main:foo.py /target:exe /out:foo2<br>
<br>Starting either foo.exe or foo2.exe fails with above error.<br><br>If I remove the import os and the line that uses <a href="http://on.name">on.name</a>, I get an executable that works...<br><br>Is this a bug or a misunderstanding in what I expect to work?<br>
If so what are the correct steps?<br><br>Thanks for your help<br><br>D.<br><br clear="all">############################<br># Dominique de Waleffe<br># ddewaleffe -at- gmail -dot- com<br># domi -at- dewaleffe -dot- org<br>
############################<br>