Title: DllNotFoundException with .NET8 on Ubuntu 24.04.2 · Issue #2582 · pythonnet/pythonnet · GitHub
Open Graph Title: DllNotFoundException with .NET8 on Ubuntu 24.04.2 · Issue #2582 · pythonnet/pythonnet
X Title: DllNotFoundException with .NET8 on Ubuntu 24.04.2 · Issue #2582 · pythonnet/pythonnet
Description: I have used Python.NET from C# on Windows for years (huge thank you to all). I'm now trying get some stuff running on Linux and .NET8. Using latest nuget for Python.NET (3.0.5) everything works great under Windows. But on Ubuntu 24.04.2 ...
Open Graph Description: I have used Python.NET from C# on Windows for years (huge thank you to all). I'm now trying get some stuff running on Linux and .NET8. Using latest nuget for Python.NET (3.0.5) everything works gre...
X Description: I have used Python.NET from C# on Windows for years (huge thank you to all). I'm now trying get some stuff running on Linux and .NET8. Using latest nuget for Python.NET (3.0.5) everything works...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/2582
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DllNotFoundException with .NET8 on Ubuntu 24.04.2","articleBody":"I have used Python.NET from C# on Windows for years (huge thank you to all). I'm now trying get some stuff running on Linux and .NET8. \n\nUsing latest nuget for Python.NET (3.0.5) everything works great under Windows. But on Ubuntu 24.04.2 LTS I get:\n\n```\n Unhandled exception. System.TypeInitializationException: The type initializer for 'Delegates' threw an exception.\n ---\u003e System.DllNotFoundException: Could not load /usr/lib/x86_64-linux-gnu/libpython3.12.so.1.0 with flags RTLD_NOW | RTLD_GLOBAL: /usr/lib/x86_64-linux-gnu/libpython3.12.so.1.0: cannot open shared object file: No such file or directory\n at Python.Runtime.Platform.PosixLoader.Load(String dllToLoad)\n at Python.Runtime.Runtime.Delegates.GetUnmanagedDll(String libraryName)\n at Python.Runtime.Runtime.Delegates..cctor()\n --- End of inner exception stack trace ---\n at Python.Runtime.Runtime.Delegates.get_Py_IsInitialized()\n at Python.Runtime.Runtime.Py_IsInitialized()\n at Python.Runtime.Runtime.\u003c\u003ec.\u003cInitialize\u003eb__32_0()\n at Python.Runtime.Runtime.TryUsingDll[T](Func`1 op)\n at Python.Runtime.Runtime.Initialize(Boolean initSigs)\n at Python.Runtime.PythonEngine.Initialize(IEnumerable`1 args, Boolean setSysArgv, Boolean initSigs)\n at Python.Runtime.PythonEngine.Initialize(Boolean setSysArgv, Boolean initSigs)\n at Python.Runtime.PythonEngine.Initialize()\n\n```\n\nPython looks OK?\n\n```\n$ ls -l /usr/lib/x86_64-linux-gnu/libpython3.12.so*\nlrwxrwxrwx 1 root root 20 Feb 4 08:48 /usr/lib/x86_64-linux-gnu/libpython3.12.so.1 -\u003e libpython3.12.so.1.0\n-rw-r--r-- 1 root root 9055112 Feb 4 08:48 /usr/lib/x86_64-linux-gnu/libpython3.12.so.1.0\n\n```\n\nCode:\n\n```\nusing Python.Runtime;\n\nConsole.WriteLine(\"Starting up ...\");\n\nRuntime.PythonDLL = \"/usr/lib/x86_64-linux-gnu/libpython3.12.so.1.0\";\n//Runtime.PythonDLL = @\"C:\\Skyworks\\Git\\Tools3\\Misc\\MiniPythonDistis\\PythonForCBPro312\\python312.dll\";\n\nConsole.WriteLine(\"Initializing Python.NET ...\");\nPythonEngine.Initialize();\nConsole.WriteLine(\"Done\");\n\nusing (Py.GIL())\n{\n dynamic hello = Py.Import(\"hello\");\n hello.say_hello();\n}\n\n```\n\nFull C# project:\n[PythonDotNetDotNET8Sample.zip](https://github.com/user-attachments/files/19722305/PythonDotNetDotNET8Sample.zip)\n\nAny tips? Thank you.","author":{"url":"https://github.com/sky9mike","@type":"Person","name":"sky9mike"},"datePublished":"2025-04-12T23:23:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2582/pythonnet/issues/2582"}
| 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:191c2f1c-1ea4-43ce-69f1-649bb16a2842 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA46:297EC:2ADFF22:3C19979:697103EB |
| html-safe-nonce | 6e6f5da01f02af94975301dbeec5e606f3a4e5ec054b9d52a57116c11e478b18 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTQ2OjI5N0VDOjJBREZGMjI6M0MxOTk3OTo2OTcxMDNFQiIsInZpc2l0b3JfaWQiOiI4MzMyMjYzNDMzOTE0MzUyNjE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1f0e9f1289983a0d120d8b4f9944274fdac91d16fb3bdaa5713645f5b4b5e629 |
| hovercard-subject-tag | issue:2990773388 |
| 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/2582/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3fb05feaeea9430cedce71f722afc8540a002fdcc3df1167353a59923435115a/pythonnet/pythonnet/issues/2582 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3fb05feaeea9430cedce71f722afc8540a002fdcc3df1167353a59923435115a/pythonnet/pythonnet/issues/2582 |
| og:image:alt | I have used Python.NET from C# on Windows for years (huge thank you to all). I'm now trying get some stuff running on Linux and .NET8. Using latest nuget for Python.NET (3.0.5) everything works gre... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sky9mike |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d17fd2bbd784dc91f3a78a2f1d2c41d9f4f8ce86136d09833e3cf21b2bde1b7 |
| 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 | e053d923fb27a9d948f8cefae8ba3bf43f7b938f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width