Importing numpy crashes Py.GIL()

If you import numpy into default code and run it in the play mode, Unity, after entering play mode for the second time, crashes. Strangely numpy works just fine for the first time it enters playmode. Both times I call this script using Py.GIL(), just like in the example. Even after using an empty .py file, that only imports numpy, it still crashes exactly after second play mode.
As it crashes unity temporarily throws this error:

SerializationException: Type 'UnityEngine.UnityLogWriter' in Assembly 'UnityEngine.CoreModule, Version=, Culture=neutral, PublicKeyToken=null' is not marked as serializable.

Any suggestions how to fix this problem? Maybe it has to do with garbage collection?

Edit: Found easier way to replicate this issue: Open unity python console and execute "import numpy". Then enter play mode and this issue repeats again

I also have this problem,have you solved it?


Same issue, happens at every domain relode. How to fix this?

The whole python api is pretty useless without numpy.

I have a similar issue and post in the forum.

After several tests, I found that it was caused by convert a C# list to numpy array. A workaround it's to convert C# list to a array then call ToPython, here is the sample code

List foo = ...
scoipe.Set("foo", foo.ToArray().ToPython())

Issue in our case happens when purely just importing numpy, even if we are doing no operations at all with numpy