Title: Crashes on .NET Core 3 and 2 on Linux · Issue #967 · pythonnet/pythonnet · GitHub
Open Graph Title: Crashes on .NET Core 3 and 2 on Linux · Issue #967 · pythonnet/pythonnet
X Title: Crashes on .NET Core 3 and 2 on Linux · Issue #967 · pythonnet/pythonnet
Description: 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(): using (Py.GIL()) { dynamic np = Py.Import("numpy"); Console.W...
Open Graph Description: 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(): using (Py.GIL()) { dy...
X Description: 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(): using (Py.GIL()) ...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/967
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crashes on .NET Core 3 and 2 on Linux","articleBody":"Can't make this work on Linux Mint 19 (Ubuntu 18.04).\r\nCompiled ReleaseMonoPy3 with XPLAT;;PYTHON3;PYTHON37;UCS4;MONO_LINUX;PYTHON_WITH_PYMALLOC.\r\nIt seems to crash on Py.GIL():\r\n\r\n```\r\nusing (Py.GIL())\r\n{\r\n dynamic np = Py.Import(\"numpy\");\r\n Console.WriteLine(np.cos(np.pi * 2));\r\n\r\n dynamic sin = np.sin;\r\n Console.WriteLine(sin(5));\r\n\r\n double c = np.cos(5) + sin(5);\r\n Console.WriteLine(c);\r\n\r\n dynamic a = np.array(new List\u003cfloat\u003e { 1, 2, 3 });\r\n Console.WriteLine(a.dtype);\r\n\r\n dynamic b = np.array(new List\u003cfloat\u003e { 6, 5, 4 }, dtype: np.int32);\r\n Console.WriteLine(b.dtype);\r\n\r\n Console.WriteLine(a * b);\r\n Console.ReadKey();\r\n}\r\n```\r\n\r\nUpon further investigation, it seems to crash in InitializePlatformData(), as\r\n\r\n`IntPtr platformModule = PyImport_ImportModule(\"platform\"); // Becomes NULL pointer`\r\n\r\nRunning this line immediately after setting `platformModule = ... `\r\n\r\n`Console.WriteLine(new PythonException().Message);`\r\n\r\nyields:\r\n\r\n**ModuleNotFoundError : No module named '_posixsubprocess'**\r\n\r\nI also tried making sure the python home and path variables are correctly set:\r\n\r\n```\r\nPythonEngine.PythonHome = @\"/usr/local/bin/python3.7\";\r\nPythonEngine.PythonPath = @\"/usr/local/lib/python3.7\";\r\n```\r\n\r\nI have no problem importing _posixsubprocess module when running the python3.7 binary from the terminal.","author":{"url":"https://github.com/emilmuller","@type":"Person","name":"emilmuller"},"datePublished":"2019-10-07T10:32:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/967/pythonnet/issues/967"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e6ffe4f7-6bf2-111d-99d5-9ebe62b49fec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E7AC:69CA6:4597DE4:5E5CB97:69709C18 |
| html-safe-nonce | b3e7d1630094c6776adef906539b3f56227e2d6218c52dc406164c7bdb53057f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0FDOjY5Q0E2OjQ1OTdERTQ6NUU1Q0I5Nzo2OTcwOUMxOCIsInZpc2l0b3JfaWQiOiI4MzAyNDMyMDcyODQwMDI3MTYwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0bd2f3910d853388166b78ba67fd0af5f0b1e7aa06d9f285a8647794589a4851 |
| hovercard-subject-tag | issue:503365556 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonnet/pythonnet/967/issue_layout |
| twitter:image | https://opengraph.githubassets.com/360c8ea6776839b66997a690545730bfdab571f9f61d1dd4dcdf231b85855863/pythonnet/pythonnet/issues/967 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/360c8ea6776839b66997a690545730bfdab571f9f61d1dd4dcdf231b85855863/pythonnet/pythonnet/issues/967 |
| og:image:alt | 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(): using (Py.GIL()) { dy... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | emilmuller |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7d6181066430cc06553c8396ca201e194ae33cb9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width