Closed
Description
This plugin works just fine in the editor, but I get a werid error on the build. The way I'm starting the script goes something like this:
var engine = UnityPython.CreateEngine();
var paths = engine.GetSearchPaths();
// I've copeid the Python folder to StreamingAssets for the libraries to work
paths.Add(Application.streamingAssetsPath + "/Python/Lib");
engine.SetSearchPaths(paths);
try
{
var source = engine.CreateScriptSourceFromFile(scriptPath);
source.Compile();
// script here is a dynamic variable
script = engine.Runtime.UseFile(scriptPath); // this is where it stops working
script.GameManager = this;
script.start();
}
catch (Exception e)
{
Debug.Log("Error: " + e);
}
The python script I am using uses the threading and Queue libraries, if that helps.
Full Error:
System.TypeInitializationException: The type initializer for 'CodecsInfo' threw an exception. ---> System.NotSupportedException: Encoding 37 data could not be found. Make sure you have correct international codeset assembly installed and enabled.
at System.Text.Encoding.GetEncoding (System.Int32 codepage) [0x0023f] in <df7127ba07dc446d9f5831a0ec7b1d63>:0
at System.Text.EncodingInfo.GetEncoding () [0x00000] in <df7127ba07dc446d9f5831a0ec7b1d63>:0
at IronPython.Runtime.Operations.StringOps+CodecsInfo.MakeCodecsDict () [0x004d1] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Operations.StringOps+CodecsInfo..cctor () [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
--- End of inner exception stack trace ---
at IronPython.Compiler.Tokenizer.TryGetEncoding (System.Text.Encoding defaultEncoding, System.String line, System.Text.Encoding& enc, System.String& encName) [0x000ea] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.GetSourceReader (System.IO.Stream stream, System.Text.Encoding defaultEncoding, System.String path) [0x000b8] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at Microsoft.Scripting.Runtime.LanguageBoundTextContentProvider.GetReader () [0x0002e] in <b4854a677cbc408eadacd3725c486fb1>:0
at Microsoft.Scripting.SourceUnit.GetReader () [0x00000] in <b4854a677cbc408eadacd3725c486fb1>:0
at IronPython.Compiler.Parser.CreateParserWorker (Microsoft.Scripting.Runtime.CompilerContext context, IronPython.PythonOptions options, System.Boolean verbatim) [0x00037] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Compiler.Parser.CreateParser (Microsoft.Scripting.Runtime.CompilerContext context, IronPython.PythonOptions options) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.ParseAndBindAst (Microsoft.Scripting.Runtime.CompilerContext context) [0x0000d] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.CompilePythonCode (Microsoft.Scripting.SourceUnit sourceUnit, Microsoft.Scripting.CompilerOptions options, Microsoft.Scripting.ErrorSink errorSink) [0x00026] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.GetScriptCode (Microsoft.Scripting.SourceUnit sourceCode, System.String moduleName, IronPython.Runtime.ModuleOptions options, IronPython.Compiler.CompilationMode mode) [0x0002d] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.GetScriptCode (Microsoft.Scripting.SourceUnit sourceCode, System.String moduleName, IronPython.Runtime.ModuleOptions options) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.CompileModule (System.String fileName, System.String moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, Microsoft.Scripting.ScriptCode& scriptCode) [0x00021] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.CompileModule (System.String fileName, System.String moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.LoadFromSourceUnit (IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, System.String name, System.String path) [0x00006] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.LoadModuleFromSource (IronPython.Runtime.CodeContext context, System.String name, System.String path) [0x00040] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.LoadFromDisk (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, System.String str) [0x00032] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportFromPathHook (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, IronPython.Runtime.List path, System.Func`5[T1,T2,T3,T4,TResult] defaultLoader) [0x0007a] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportFromPath (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, IronPython.Runtime.List path) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportTopAbsolute (IronPython.Runtime.CodeContext context, System.String name) [0x00069] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportModule (IronPython.Runtime.CodeContext context, System.Object globals, System.String modName, System.Boolean bottom, System.Int32 level) [0x001da] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Modules.Builtin.__import__ (IronPython.Runtime.CodeContext context, System.String name, System.Object globals, System.Object locals, System.Object fromlist, System.Int32 level) [0x0003c] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at (wrapper delegate-invoke) System.Func`7[IronPython.Runtime.CodeContext,System.String,System.Object,System.Object,System.Object,System.Int32,System.Object].invoke_TResult_T1_T2_T3_T4_T5_T6(IronPython.Runtime.CodeContext,string,object,object,object,int)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`7[T0,T1,T2,T3,T4,T5,TRet].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x0004f] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet] (T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) [0x000a0] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at IronPython.Runtime.Importer.ImportLightThrow (IronPython.Runtime.CodeContext context, System.String fullName, IronPython.Runtime.PythonTuple from, System.Int32 level) [0x0002d] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Operations.PythonOps.ImportBottom (IronPython.Runtime.CodeContext context, System.String fullName, System.Int32 level) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at Microsoft.Scripting.Interpreter.FuncCallInstruction`4[T0,T1,T2,TRet].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x0004f] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet] (T0 arg0) [0x0003e] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at IronPython.Compiler.RuntimeScriptCode.InvokeTarget (Microsoft.Scripting.Runtime.Scope scope) [0x0006a] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Compiler.RuntimeScriptCode.Run (Microsoft.Scripting.Runtime.Scope scope) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.InitializeModule (System.String fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) [0x00087] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.CompileModule (System.String fileName, System.String moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, Microsoft.Scripting.ScriptCode& scriptCode) [0x0004f] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.CompileModule (System.String fileName, System.String moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.LoadFromSourceUnit (IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, System.String name, System.String path) [0x00006] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.LoadModuleFromSource (IronPython.Runtime.CodeContext context, System.String name, System.String path) [0x00040] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.LoadFromDisk (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, System.String str) [0x00032] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportFromPathHook (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, IronPython.Runtime.List path, System.Func`5[T1,T2,T3,T4,TResult] defaultLoader) [0x0007a] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportFromPath (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, IronPython.Runtime.List path) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportTopAbsolute (IronPython.Runtime.CodeContext context, System.String name) [0x00069] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportModule (IronPython.Runtime.CodeContext context, System.Object globals, System.String modName, System.Boolean bottom, System.Int32 level) [0x001da] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Modules.Builtin.__import__ (IronPython.Runtime.CodeContext context, System.String name, System.Object globals, System.Object locals, System.Object fromlist, System.Int32 level) [0x0003c] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at (wrapper delegate-invoke) System.Func`7[IronPython.Runtime.CodeContext,System.String,System.Object,System.Object,System.Object,System.Int32,System.Object].invoke_TResult_T1_T2_T3_T4_T5_T6(IronPython.Runtime.CodeContext,string,object,object,object,int)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`7[T0,T1,T2,T3,T4,T5,TRet].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x0004f] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet] (T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) [0x000a0] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at IronPython.Runtime.Importer.ImportLightThrow (IronPython.Runtime.CodeContext context, System.String fullName, IronPython.Runtime.PythonTuple from, System.Int32 level) [0x0002d] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Operations.PythonOps.ImportWithNames (IronPython.Runtime.CodeContext context, System.String fullName, System.String[] names, System.Int32 level) [0x0000a] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at Microsoft.Scripting.Interpreter.FuncCallInstruction`5[T0,T1,T2,T3,TRet].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x0004f] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet] (T0 arg0) [0x0003e] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at IronPython.Compiler.RuntimeScriptCode.InvokeTarget (Microsoft.Scripting.Runtime.Scope scope) [0x0006a] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Compiler.RuntimeScriptCode.Run (Microsoft.Scripting.Runtime.Scope scope) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.InitializeModule (System.String fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) [0x00087] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.CompileModule (System.String fileName, System.String moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, Microsoft.Scripting.ScriptCode& scriptCode) [0x0004f] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.PythonContext.CompileModule (System.String fileName, System.String moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.LoadFromSourceUnit (IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, System.String name, System.String path) [0x00006] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.LoadModuleFromSource (IronPython.Runtime.CodeContext context, System.String name, System.String path) [0x00040] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.LoadFromDisk (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, System.String str) [0x00032] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportFromPathHook (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, IronPython.Runtime.List path, System.Func`5[T1,T2,T3,T4,TResult] defaultLoader) [0x0007a] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportFromPath (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, IronPython.Runtime.List path) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportTopAbsolute (IronPython.Runtime.CodeContext context, System.String name) [0x00069] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Importer.ImportModule (IronPython.Runtime.CodeContext context, System.Object globals, System.String modName, System.Boolean bottom, System.Int32 level) [0x001da] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Modules.Builtin.__import__ (IronPython.Runtime.CodeContext context, System.String name, System.Object globals, System.Object locals, System.Object fromlist, System.Int32 level) [0x0003c] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at (wrapper delegate-invoke) System.Func`7[IronPython.Runtime.CodeContext,System.String,System.Object,System.Object,System.Object,System.Int32,System.Object].invoke_TResult_T1_T2_T3_T4_T5_T6(IronPython.Runtime.CodeContext,string,object,object,object,int)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`7[T0,T1,T2,T3,T4,T5,TRet].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x0004f] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.LightLambda.Run7[T0,T1,T2,T3,T4,T5,T6,TRet] (T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) [0x000a0] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at IronPython.Runtime.Importer.ImportLightThrow (IronPython.Runtime.CodeContext context, System.String fullName, IronPython.Runtime.PythonTuple from, System.Int32 level) [0x0002d] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Runtime.Operations.PythonOps.ImportTop (IronPython.Runtime.CodeContext context, System.String fullName, System.Int32 level) [0x00000] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at Microsoft.Scripting.Interpreter.FuncCallInstruction`4[T0,T1,T2,TRet].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x00000] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) [0x0004f] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet] (T0 arg0, T1 arg1) [0x0004d] in <bdde1939ff4d4d6b828ba549cdd24694>:0
at IronPython.Compiler.PythonScriptCode.RunWorker (IronPython.Runtime.CodeContext ctx) [0x0001b] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Compiler.PythonScriptCode.Run (Microsoft.Scripting.Runtime.Scope scope) [0x00023] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Compiler.RuntimeScriptCode.InvokeTarget (Microsoft.Scripting.Runtime.Scope scope) [0x000c6] in <0569a20e5dd94f74a766cc11c6214b7c>:0
at IronPython.Compiler.RuntimeScriptCode.Run (Microsoft.Scripting.Runtime.Scope scope) [0x00000] in <0569a20e5dd94f74a766c<message truncated>