2

Is it possible to deploy a .NET Maui application with embed python by using python.net to the iOS and Android platforms?

I just learned that Kivy and Beeware can get it done but I'd love to stick to .NET as I have a lot more experience with it and the python portion for this project is really small (although, very much needed).

Thanks for your guidance!

csharpnet
  • 45
  • 4
  • [pythonnet nuget](https://www.nuget.org/packages/pythonnet#supportedframeworks-body-tab) mentions net 6/7 android/ios, so it should be possible. Might have to add `#if android`/`ios` startup code. I don't know the details. Add that nuget, attempt to follow any startup instructions at that link. If you get stuck, add to question all relevant code, and exactly what happens. – ToolmakerSteve Jun 05 '23 at 19:19
  • I guess yes you can achieve it, if you check the package details page on: https://www.nuget.org/packages/pythonnet#supportedframeworks-body-tab here will can see the supported architectures. – Blu Jun 06 '23 at 07:11
  • 1
    So, I'm able to run locally in my windows 11 machine a .NET Maui simple app that has the pythonnet nuget package. I can successfully get data from a python function from my C# code. Note that I do have a python env local in my windows machine and in my C# code I have: Runtime.PythonDLL = @"C:\Users\netland\AppData\Local\Programs\Python\Python311\python311.dll"; I'm not sure how this translates to deploying to Android and iOS. How do we get to create a matching env there with its dependent python libraries? What should be the path for Runtime.PythonDLL ? – csharpnet Jun 06 '23 at 15:50
  • @csharpnet Did you figure this out? – Little Endian Aug 23 '23 at 23:09

0 Answers0