Я хочу иметь возможность использовать библиотеки geopy и geopandas в Unity. Я установил IronPython 3, но не могу понять, как упорядочить файлы geopy или geopandas, чтобы их можно было импортировать с помощью сценария IronPython в Unity.
Я попытался поместить извлеченные файлы в Активы -> Плагины.
Совет приветствуется.
Примечание. Я просмотрел pip для IronPython, но это для IronPython 2, а я использую 3.
Редактировать:
Я пробовал импортировать модуль так:
импорт системы
sys.path.append('C:\Users\make_c_sharp_objects_3\Assets\Plugins\Lib\geopy') импортировать географию
Но я получаю сообщение об ошибке:
SyntaxErrorException: Non-ASCII character '\xc3' in file C:\Users\make_c_sharp_objects_3\Assets\Plugins\Lib\geopy\geocoders\__init__.py on line 81, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
IronPython.Compiler.Parser.ParseFile (System.Boolean makeModule, System.Boolean returnValue) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.PythonContext.ParseAndBindAst (Microsoft.Scripting.Runtime.CompilerContext context) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.PythonContext.CompilePythonCode (Microsoft.Scripting.SourceUnit sourceUnit, Microsoft.Scripting.CompilerOptions options, Microsoft.Scripting.ErrorSink errorSink) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.PythonContext.GetScriptCode (Microsoft.Scripting.SourceUnit sourceCode, System.String moduleName, IronPython.Runtime.ModuleOptions options, IronPython.Compiler.CompilationMode mode) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.PythonContext.GetScriptCode (Microsoft.Scripting.SourceUnit sourceCode, System.String moduleName, IronPython.Runtime.ModuleOptions options) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.PythonContext.CompileModule (System.String fileName, System.String moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, Microsoft.Scripting.ScriptCode& scriptCode) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.PythonContext.CompileModule (System.String fileName, System.String moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.LoadFromSourceUnit (IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, System.String name, System.String path) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.LoadModuleFromSource (IronPython.Runtime.CodeContext context, System.String name, System.String path) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.LoadPackageFromSource (IronPython.Runtime.CodeContext context, System.String name, System.String path) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.LoadFromDisk (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, System.String str) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
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) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.ImportFromPath (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, IronPython.Runtime.List path) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.ImportNestedModule (IronPython.Runtime.CodeContext context, IronPython.Runtime.PythonModule module, System.String[] parts, System.Int32 current, IronPython.Runtime.List path) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.ImportModuleFrom (IronPython.Runtime.CodeContext context, System.Object from, System.String[] parts, System.Int32 current) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.ImportModule (IronPython.Runtime.CodeContext context, System.Object globals, System.String modName, System.Boolean bottom, System.Int32 level) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Modules.Builtin.__import__ (IronPython.Runtime.CodeContext context, System.String name, System.Object globals, System.Object locals, System.Object fromlist, System.Int32 level) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
Microsoft.Scripting.Interpreter.FuncCallInstruction`7[T0,T1,T2,T3,T4,T5,TRet].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) (at <6a70babe64d34e1b9136298538676a61>:0)
Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) (at <6a70babe64d34e1b9136298538676a61>:0)
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) (at <6a70babe64d34e1b9136298538676a61>:0)
IronPython.Runtime.Importer.ImportLightThrow (IronPython.Runtime.CodeContext context, System.String fullName, IronPython.Runtime.PythonTuple from, System.Int32 level) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.Import (IronPython.Runtime.CodeContext context, System.String fullName, IronPython.Runtime.PythonTuple from, System.Int32 level) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Operations.PythonOps.ImportStar (IronPython.Runtime.CodeContext context, System.String fullName, System.Int32 level) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
Microsoft.Scripting.Interpreter.ActionCallInstruction`3[T0,T1,T2].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) (at <6a70babe64d34e1b9136298538676a61>:0)
Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) (at <6a70babe64d34e1b9136298538676a61>:0)
Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet] (T0 arg0) (at <6a70babe64d34e1b9136298538676a61>:0)
IronPython.Compiler.RuntimeScriptCode.InvokeTarget (Microsoft.Scripting.Runtime.Scope scope) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Compiler.RuntimeScriptCode.Run (Microsoft.Scripting.Runtime.Scope scope) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.PythonContext.InitializeModule (System.String fileName, IronPython.Runtime.ModuleContext moduleContext, Microsoft.Scripting.ScriptCode scriptCode, IronPython.Runtime.ModuleOptions options) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.PythonContext.CompileModule (System.String fileName, System.String moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options, Microsoft.Scripting.ScriptCode& scriptCode) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.PythonContext.CompileModule (System.String fileName, System.String moduleName, Microsoft.Scripting.SourceUnit sourceCode, IronPython.Runtime.ModuleOptions options) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.LoadFromSourceUnit (IronPython.Runtime.CodeContext context, Microsoft.Scripting.SourceUnit sourceCode, System.String name, System.String path) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.LoadModuleFromSource (IronPython.Runtime.CodeContext context, System.String name, System.String path) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.LoadPackageFromSource (IronPython.Runtime.CodeContext context, System.String name, System.String path) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.LoadFromDisk (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, System.String str) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
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) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.ImportFromPath (IronPython.Runtime.CodeContext context, System.String name, System.String fullName, IronPython.Runtime.List path) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.ImportTopAbsolute (IronPython.Runtime.CodeContext context, System.String name) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Importer.ImportModule (IronPython.Runtime.CodeContext context, System.Object globals, System.String modName, System.Boolean bottom, System.Int32 level) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Modules.Builtin.__import__ (IronPython.Runtime.CodeContext context, System.String name, System.Object globals, System.Object locals, System.Object fromlist, System.Int32 level) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
Microsoft.Scripting.Interpreter.FuncCallInstruction`7[T0,T1,T2,T3,T4,T5,TRet].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) (at <6a70babe64d34e1b9136298538676a61>:0)
Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) (at <6a70babe64d34e1b9136298538676a61>:0)
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) (at <6a70babe64d34e1b9136298538676a61>:0)
IronPython.Runtime.Importer.ImportLightThrow (IronPython.Runtime.CodeContext context, System.String fullName, IronPython.Runtime.PythonTuple from, System.Int32 level) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Runtime.Operations.PythonOps.ImportTop (IronPython.Runtime.CodeContext context, System.String fullName, System.Int32 level) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
Microsoft.Scripting.Interpreter.FuncCallInstruction`4[T0,T1,T2,TRet].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) (at <6a70babe64d34e1b9136298538676a61>:0)
Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame) (at <6a70babe64d34e1b9136298538676a61>:0)
Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet] (T0 arg0, T1 arg1) (at <6a70babe64d34e1b9136298538676a61>:0)
IronPython.Compiler.PythonScriptCode.RunWorker (IronPython.Runtime.CodeContext ctx) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Compiler.PythonScriptCode.Run (Microsoft.Scripting.Runtime.Scope scope) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Compiler.RuntimeScriptCode.InvokeTarget (Microsoft.Scripting.Runtime.Scope scope) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
IronPython.Compiler.RuntimeScriptCode.Run (Microsoft.Scripting.Runtime.Scope scope) (at <4e01c3e2a6d647c6b8da08b7a074e47b>:0)
Microsoft.Scripting.SourceUnit.Execute (Microsoft.Scripting.Runtime.Scope scope, Microsoft.Scripting.ErrorSink errorSink) (at <ab6bb51465f44fb2b67d2937d9bd64f2>:0)
Microsoft.Scripting.SourceUnit.Execute (Microsoft.Scripting.Runtime.Scope scope) (at <ab6bb51465f44fb2b67d2937d9bd64f2>:0)
Microsoft.Scripting.Hosting.ScriptSource.Execute (Microsoft.Scripting.Hosting.ScriptScope scope) (at <ab6bb51465f44fb2b67d2937d9bd64f2>:0)
(wrapper remoting-invoke-with-check) Microsoft.Scripting.Hosting.ScriptSource.Execute(Microsoft.Scripting.Hosting.ScriptScope)
Microsoft.Scripting.Hosting.ScriptEngine.ExecuteFile (System.String path, Microsoft.Scripting.Hosting.ScriptScope scope) (at <ab6bb51465f44fb2b67d2937d9bd64f2>:0)
Microsoft.Scripting.Hosting.ScriptEngine.ExecuteFile (System.String path) (at <ab6bb51465f44fb2b67d2937d9bd64f2>:0)
(wrapper remoting-invoke-with-check) Microsoft.Scripting.Hosting.ScriptEngine.ExecuteFile(string)
NewBehaviourScript.Start () (at Assets/NewBehaviourScript.cs:21)
Я нашел обходной путь с помощью другой программы — пакет, на который ссылается пост, по-прежнему не работает, и было бы здорово, если бы он работал.
Я узнал, что эта проблема неразрешима, потому что такие пакеты, как geopandas, полагаются на numpy, а IronPython не поддерживает numpy.
Я полагаю, это решается тогда? stackoverflow.com/questions/74575575/…