Title: Unable to run with Python debug library · Issue #1412 · pythonnet/pythonnet · GitHub
Open Graph Title: Unable to run with Python debug library · Issue #1412 · pythonnet/pythonnet
X Title: Unable to run with Python debug library · Issue #1412 · pythonnet/pythonnet
Description: Environment Pythonnet version: master@ f2dc8f1 Python version: 3.6 (probably others) Operating System: Ubuntu 20.04 (probably others) .NET Runtime: netcore 3.1, mono Details While debugging a build failure in #1402 , I tried to use a deb...
Open Graph Description: Environment Pythonnet version: master@ f2dc8f1 Python version: 3.6 (probably others) Operating System: Ubuntu 20.04 (probably others) .NET Runtime: netcore 3.1, mono Details While debugging a build...
X Description: Environment Pythonnet version: master@ f2dc8f1 Python version: 3.6 (probably others) Operating System: Ubuntu 20.04 (probably others) .NET Runtime: netcore 3.1, mono Details While debugging a build...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/1412
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unable to run with Python debug library","articleBody":"### Environment\r\n\r\n- Pythonnet version: master@ f2dc8f1\r\n- Python version: 3.6 (probably others)\r\n- Operating System: Ubuntu 20.04 (probably others)\r\n- .NET Runtime: netcore 3.1, mono\r\n\r\n### Details\r\n\r\n- While debugging a build failure in #1402 , I tried to use a debug build of python,\r\n\r\nnote: Python 3.6 was installed from the deadsnakes PPA.\r\n\r\nRepro:\r\n- Install Python debug packages\r\n- Create a and use a virtual environment using the Python debug executable\r\n- Apply/cherry-pick https://github.com/filmor/pythonnet/commit/ee3503b25b0c475fc9dee74398107fc61ca411ab to run with a static libpython\r\n- change the `dotnet_config` to `\"debug\"` (line ~43 in setup.py)\r\n- run `python -m pythonnet.find_libpython --export` and export the result in the environment, make sure it points to the debug library\r\n- `python setup.py develop` then run `pytest` (with either `--runtime mono` or `--runtime netcore`)\r\n- It will error out with:\r\n```\r\nFailed to initialize pythonnet: System.TypeInitializationException: The type initializer for 'Delegates' threw an exception. ---\u003e System.MissingMethodException: Failed to load symbol PyModule_Create2: /home/user/dev/36-dbg/bin/python: undefined symbol: PyModule_Create2\r\n at Python.Runtime.Platform.LinuxLoader.GetFunction (System.IntPtr dllHandle, System.String name) [0x00050] in \u003c12881a58dd5544c59504de515c25928b\u003e:0\r\n at Python.Runtime.Runtime+Delegates.GetFunctionByName (System.String functionName, System.IntPtr libraryHandle) [0x00000] in \u003c12881a58dd5544c59504de515c25928b\u003e:0\r\n at Python.Runtime.Runtime+Delegates..cctor () [0x01793] in \u003c12881a58dd5544c59504de515c25928b\u003e:0\r\n --- End of inner exception stack trace ---\r\n at Python.Runtime.Runtime.PyGILState_Ensure () [0x00000] in \u003c12881a58dd5544c59504de515c25928b\u003e:0\r\n at Python.Runtime.Loader.Initialize (System.IntPtr data, System.Int32 size) [0x0003c] in \u003c12881a58dd5544c59504de515c25928b\u003e:0\r\n at Python.Runtime.Runtime.PyGILState_Ensure () [0x00000] in \u003c12881a58dd5544c59504de515c25928b\u003e:0\r\n at Python.Runtime.Loader.Initialize (System.IntPtr data, System.Int32 size) [0x0003c] in \u003c12881a58dd5544c59504de515c25928b\u003e:0 INTERNALERROR\u003e Traceback (most recent call last):\r\nINTERNALERROR\u003e File \"/home/user/dev/36-dbg/lib/python3.6/site-packages/_pytest/main.py\", line 265, in wrap_session\r\n```\r\n\r\nIf I fix that, there's another error in the TypeOffsets ctor (all offsets are null)\r\n","author":{"url":"https://github.com/BadSingleton","@type":"Person","name":"BadSingleton"},"datePublished":"2021-03-09T16:07:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1412/pythonnet/issues/1412"}
| 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:fd005618-2ef7-5eb8-bd05-92a4eb971323 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A2D2:7A0AD:322367E:32DECF2:69703763 |
| html-safe-nonce | fc7fda6e7c333248b5693e7dbc35947b4e8e34574288b7f033db98d460ad6250 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMkQyOjdBMEFEOjMyMjM2N0U6MzJERUNGMjo2OTcwMzc2MyIsInZpc2l0b3JfaWQiOiI1NDA1MzA5NDg4NzQwNzEwMjQzIiwicmVnaW9uX2VkZ2UiOiJzZWEiLCJyZWdpb25fcmVuZGVyIjoic2VhIn0= |
| visitor-hmac | a17e00e7e567c4163b700fb5c6623fa9c61fc556a999d4fa3841e154ba9c4f60 |
| hovercard-subject-tag | issue:826163531 |
| 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/1412/issue_layout |
| twitter:image | https://opengraph.githubassets.com/318a34d3980b57d01282b9a33470ed06b10c1ed68a3a6c26a9811c47ebd3425c/pythonnet/pythonnet/issues/1412 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/318a34d3980b57d01282b9a33470ed06b10c1ed68a3a6c26a9811c47ebd3425c/pythonnet/pythonnet/issues/1412 |
| og:image:alt | Environment Pythonnet version: master@ f2dc8f1 Python version: 3.6 (probably others) Operating System: Ubuntu 20.04 (probably others) .NET Runtime: netcore 3.1, mono Details While debugging a build... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | BadSingleton |
| 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 | f643964067a552f02067066d6a910b2f90a5721f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width