Closed Dave3991 closed 3 years ago
check the last comment of #1 maybe that is the problem for you too?
I would like to try it, but I don't know how to remove "PYTHON_WITH_PYMALLOC" during build of pythonnet :(
ok, let me update the nuget quickly. hang on
I removed pymalloc from linux and mac versions of pythonnet for py3.8. check out the pythonnet nuget v2.5.1.1
@henon I installed library you metioned and I'm getting different error, btw thanks for effort :+1:
Hello World!
Unhandled exception. System.MissingMethodException: Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.
at Python.Runtime.CodeGenerator..ctor()
at Python.Runtime.DelegateManager..ctor()
at Python.Runtime.PythonEngine.Initialize(IEnumerable`1 args, Boolean setSysArgv, Boolean initSigs)
at Python.Runtime.PythonEngine.Initialize(Boolean setSysArgv, Boolean initSigs)
at Python.Runtime.PythonEngine.Initialize()
at PythonExecutor.Program.Main(String[] args) in /home/david/Documents/personal/gitlab/inventory-management/InventoryManagement/app/PythonExecutor/Program.cs:line 26
Process finished with exit code 134.
With that I can't help you further. Please make a reproduction of the error without involvement of Python.Included so the pythonnet guys are not suspecting me of having done something wrong on my end and create an issue on their repo.
I don't know what happend, but I try several other pythonnet nugets then I install back pythonnet_netstandard_py38_linux version 2.5.1.1 and this code starts to work
namespace PythonExecutor
{
internal class Program
{
private static void Main(string[] args)
{
Console.WriteLine("Hello World!");
using (Py.GIL())
{
dynamic sys=PythonEngine.ImportModule("sys");
Console.WriteLine("Python version: " + sys.version);
}
}
}
}
@henon big thank you for your patience and willingness :+1: you are good guy
Enviroment: Ubuntu 20.04
Error:
Steps to reproduce: run this code:
I think it's because it's not multiplatform ?