-
Notifications
You must be signed in to change notification settings - Fork 747
Crashes on .NET Core 3 and 2 on Linux #967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please verify your installation. If you already get a |
@filmor I respectfully disagree about this issue having nothing to do with Python.NET. Please see my comment in #891. I think the potential source of confusion is that the [I assume that this is why So when This crash is, I think, precisely due to Python.NET running C Python code (importing I don't think this crash reflects a configuration problem. I think this crash reflects on why For .NET Core 3.x, we could run this code instead of using
PS, I believe this analysis explains issue #946 also. |
@Jeff17Robbins Well, Python.NET didn't decide to default to Nevertheless, you are completely right that this whole We wouldn't even need to assign our own values here anymore, we can just use the |
@filmor Conceivably, for .NET Core 3.1 anyway, we could override that unfortunate choice using System.Runtime.InteropServices.DllImportResolver. I'm not clear on how to get a call to this to run before all those It's not a solution for .NET Framework 4.7.x. But it could tidy things up for .NET Core on Linux and remove the need for the second call to |
Can't make this work on Linux Mint 19 (Ubuntu 18.04).
Compiled ReleaseMonoPy3 with XPLAT;;PYTHON3;PYTHON37;UCS4;MONO_LINUX;PYTHON_WITH_PYMALLOC.
It seems to crash on Py.GIL():
Upon further investigation, it seems to crash in InitializePlatformData(), as
IntPtr platformModule = PyImport_ImportModule("platform"); // Becomes NULL pointer
Running this line immediately after setting
platformModule = ...
Console.WriteLine(new PythonException().Message);
yields:
ModuleNotFoundError : No module named '_posixsubprocess'
I also tried making sure the python home and path variables are correctly set:
I have no problem importing _posixsubprocess module when running the python3.7 binary from the terminal.
The text was updated successfully, but these errors were encountered: