Replies: 6 comments
|
Same problem |
|
@Maskliv Found solution. You have to call PythonEngine.Shutdown(); after you finished working with Python. |
|
If I call UPDATE: |
|
Calling shutdown using stripped down numpy sample I get: Fatal Python error: auto-releasing thread-state, but no thread-state for this thread using System;
using Python.Runtime;
namespace test
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
using (Python.Runtime.Py.GIL())
{
dynamic np = Python.Runtime.Py.Import("numpy");
Console.WriteLine(np.cos(np.pi * 2));
PythonEngine.Shutdown();
}
}
}
} |
|
I would expect to place |
|
@MrM40 doing as you suggest, works also for me properly without any issue! I would tend to close such issues actually. |
Uh oh!
There was an error while loading. Please reload this page.
Here is my code
Code works fine but doesn't finish the execution and when i debug, can see that on the line marked the execution gets stuck , when i comment the "using(Py.GIL())" the code finish normally as a regular console script write on C#.
All reactions