Как установить пакет Python для IronPython в Unity

Я хочу иметь возможность использовать библиотеки 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)

Я полагаю, это решается тогда? stackoverflow.com/questions/74575575/…

derHugo 25.11.2022 20:22

Я нашел обходной путь с помощью другой программы — пакет, на который ссылается пост, по-прежнему не работает, и было бы здорово, если бы он работал.

generic 25.11.2022 20:24
Стоит ли изучать PHP в 2023-2024 годах?
Стоит ли изучать PHP в 2023-2024 годах?
Привет всем, сегодня я хочу высказать свои соображения по поводу вопроса, который я уже много раз получал в своем сообществе: "Стоит ли изучать PHP в...
Поведение ключевого слова "this" в стрелочной функции в сравнении с нормальной функцией
Поведение ключевого слова "this" в стрелочной функции в сравнении с нормальной функцией
В JavaScript одним из самых запутанных понятий является поведение ключевого слова "this" в стрелочной и обычной функциях.
Приемы CSS-макетирования - floats и Flexbox
Приемы CSS-макетирования - floats и Flexbox
Здравствуйте, друзья-студенты! Готовы совершенствовать свои навыки веб-дизайна? Сегодня в нашем путешествии мы рассмотрим приемы CSS-верстки - в...
Тестирование функциональных ngrx-эффектов в Angular 16 с помощью Jest
В системе управления состояниями ngrx, совместимой с Angular 16, появились функциональные эффекты. Это здорово и делает код определенно легче для...
Концепция локализации и ее применение в приложениях React ⚡️
Концепция локализации и ее применение в приложениях React ⚡️
Локализация - это процесс адаптации приложения к различным языкам и культурным требованиям. Это позволяет пользователям получить опыт, соответствующий...
Пользовательский скаляр GraphQL
Пользовательский скаляр GraphQL
Листовые узлы системы типов GraphQL называются скалярами. Достигнув скалярного типа, невозможно спуститься дальше по иерархии типов. Скалярный тип...
0
2
140
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

Я узнал, что эта проблема неразрешима, потому что такие пакеты, как geopandas, полагаются на numpy, а IronPython не поддерживает numpy.

Другие вопросы по теме