Question by
Takahashi73 · Oct 16, 2017 at 10:48 AM ·
script errorexceptionversion
IronPython will fail on Unity 2017.2.0f3
Hello Everyone.
I am running IronPython on Unity.
Although it was working on version 2017.1.2f1 or earlier, an error occurs on version 2017.2.0f3.
This is Python script.
import clr
clr.AddReference("UnityEngine")
import UnityEngine
UnityEngine.Debug.Log("Test message from Python.")
This is the error message.
ImportException: No module named UnityEngine
Microsoft.Scripting.Runtime.LightExceptions.ThrowException (Microsoft.Scripting.Runtime.LightException lightEx)
Microsoft.Scripting.Runtime.LightExceptions.CheckAndThrow (System.Object value)
Microsoft.Scripting.Interpreter.FuncCallInstruction`2[System.Object,System.Object].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame)
Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame)
Your help would be greatly appreciated.
Comment
How did you get access to the Python script, I ve been trying to do that but no luck. Please answer me
Answer by junestone · Nov 24, 2017 at 06:51 AM
You need to reference other dlls. Unity-coremodule.dll, UnityEngine.dll, Assembly-Firstpass.dll etc. The name above is not precise though. check it out yourself.