Title: DllNotFoundException:Could not load python311.dll · Issue #2502 · pythonnet/pythonnet · GitHub
Open Graph Title: DllNotFoundException:Could not load python311.dll · Issue #2502 · pythonnet/pythonnet
X Title: DllNotFoundException:Could not load python311.dll · Issue #2502 · pythonnet/pythonnet
Description: Environment Pythonnet version: 3.03 Python version: 3.11 Operating System: Windows .NET Runtime:net8.0 Details Describe what you were trying to get done. I am using pythonnet to write a C# project, but I encountered a problem with the Ch...
Open Graph Description: Environment Pythonnet version: 3.03 Python version: 3.11 Operating System: Windows .NET Runtime:net8.0 Details Describe what you were trying to get done. I am using pythonnet to write a C# project,...
X Description: Environment Pythonnet version: 3.03 Python version: 3.11 Operating System: Windows .NET Runtime:net8.0 Details Describe what you were trying to get done. I am using pythonnet to write a C# project,...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/2502
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DllNotFoundException:Could not load python311.dll","articleBody":"### Environment\r\n\r\n- Pythonnet version: 3.03\r\n- Python version: 3.11\r\n- Operating System: Windows\r\n- .NET Runtime:net8.0\r\n\r\n### Details\r\n\r\n- Describe what you were trying to get done.\r\n\r\n I am using pythonnet to write a C# project, but I encountered a problem with the Chinese path.When \r\n PythonEngine.Initialize(),Rethrow as DllNotFoundException: Could not load D:/Test中文/v2647_Debug/StreamingAssets/python-3.11.3- \r\n embed-amd64/python311.dll.If it is a non-Chinese path, everything works fine.\r\n\r\n- What commands did you run to trigger this issue? If you can provide a\r\n```python\r\n var pythonHome= $\"{Application.streamingAssetsPath}/{PythonFolder}\";\r\n var pythonPath = string.Join(\";\",\r\n $\"{pythonHome}/Lib/site-packages\",\r\n $\"{pythonHome}/{PythonZip}\",\r\n $\"{pythonHome}\"\r\n );\r\n var scripts = $\"{pythonHome}/Scripts\";\r\n var path = Environment.GetEnvironmentVariable(\"PATH\")?.TrimEnd(';');\r\n path = string.IsNullOrEmpty(path) ? $\"{pythonHome};{scripts}\" : $\"{pythonHome};{scripts};{path}\";\r\n Environment.SetEnvironmentVariable(\"PATH\", path, EnvironmentVariableTarget.Process);\r\n Environment.SetEnvironmentVariable(\"DYLD_LIBRARY_PATH\", $\"{pythonHome}/Lib\", EnvironmentVariableTarget.Process);\r\n Environment.SetEnvironmentVariable(\"PYTHONNET_PYDLL\", $\"{pythonHome}/{PythonDll}\", EnvironmentVariableTarget.Process);\r\n PythonEngine.PythonHome = pythonHome;\r\n PythonEngine.PythonPath = pythonPath;\r\n Runtime.PythonDLL = $\"{pythonHome}/{PythonDll}\";\r\n PythonEngine.Initialize();\r\n```\r\n\r\n\r\n- If there was a crash, please include the traceback here.\r\n\r\n```python\r\nWin32Exception: 找不到指定的模块。\r\nRethrow as DllNotFoundException: Could not load D:/USD_中文/USD_中文/UnityApp/FactoryStream_Data/StreamingAssets/python-3.11.3-embed-amd64/python311.dll.\r\n at Python.Runtime.Platform.WindowsLoader.Load (System.String dllToLoad) [0x00037] in \u003ce6978fb1f69f4558807e0a3431702c70\u003e:0 \r\n at Python.Runtime.Runtime+Delegates.GetUnmanagedDll (System.String libraryName) [0x00009] in \u003ce6978fb1f69f4558807e0a3431702c70\u003e:0 \r\n at Python.Runtime.Runtime+Delegates..cctor () [0x0000a] in \u003ce6978fb1f69f4558807e0a3431702c70\u003e:0 \r\nRethrow as TypeInitializationException: The type initializer for 'Delegates' threw an exception.\r\n at Python.Runtime.Runtime.PyGILState_Ensure () [0x00000] in \u003ce6978fb1f69f4558807e0a3431702c70\u003e:0 \r\n at Python.Runtime.PythonEngine.AcquireLock () [0x00000] in \u003ce6978fb1f69f4558807e0a3431702c70\u003e:0 \r\n at Python.Runtime.Py+GILState..ctor () [0x00006] in \u003ce6978fb1f69f4558807e0a3431702c70\u003e:0 \r\n at Python.Runtime.Py.GIL () [0x00007] in \u003ce6978fb1f69f4558807e0a3431702c70\u003e:0 \r\n at FSM.USD.UsdEngine.Init () [0x00000] in \u003c409251060049431d992f8d5358cc24fc\u003e:0 \r\n at FSM.USD.UsdEngine..ctor () [0x00006] in \u003c409251060049431d992f8d5358cc24fc\u003e:0 \r\n at (wrapper managed-to-native) System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,object,object[],System.Exception\u0026)\r\n at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in \u003c321eb2db7c6d43ea8fc39b54eaca3452\u003e:0 \r\nRethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.\r\n at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x0001a] in \u003c321eb2db7c6d43ea8fc39b54eaca3452\u003e:0 \r\n at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00095] in \u003c321eb2db7c6d43ea8fc39b54eaca3452\u003e:0 \r\n at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x00009] in \u003c321eb2db7c6d43ea8fc39b54eaca3452\u003e:0 \r\n at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark\u0026 stackMark) [0x00027] in \u003c321eb2db7c6d43ea8fc39b54eaca3452\u003e:0 \r\n at System.Activator.CreateInstance[T] () [0x00015] in \u003c321eb2db7c6d43ea8fc39b54eaca3452\u003e:0 \r\n at Singleton`1[T]..cctor () [0x00000] in \u003c409251060049431d992f8d5358cc24fc\u003e:0 \r\nRethrow as TypeInitializationException: The type initializer for 'Singleton`1' threw an exception.\r\n at ProtocolMgrWPF.ImportModelFromCloudLibraryByWpf (SharedMemoryLib.IMsg msg) [0x00197] in \u003c409251060049431d992f8d5358cc24fc\u003e:0 \r\n at ProtocolMgrWPF.ImportResourceByPathByWPF (SharedMemoryLib.IMsg message) [0x00052] in \u003c409251060049431d992f8d5358cc24fc\u003e:0 \r\n at NetManager.MessageUpdate () [0x000ba] in \u003c409251060049431d992f8d5358cc24fc\u003e:0 \r\n at NetManager.FixedUpdate () [0x00000] in \u003c409251060049431d992f8d5358cc24fc\u003e:0 \r\n```\r\nGreetings!","author":{"url":"https://github.com/roywang91","@type":"Person","name":"roywang91"},"datePublished":"2024-11-04T07:43:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2502/pythonnet/issues/2502"}
| 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:f6f1e2a2-6058-eb9a-2f42-f4732796d4f4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D310:36ED6F:1AB4A94:235D4D1:69719F47 |
| html-safe-nonce | 9d7725ff91e770fbab55c4c6f0360690b5e066fd74b1ff86654e8309183166b7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzEwOjM2RUQ2RjoxQUI0QTk0OjIzNUQ0RDE6Njk3MTlGNDciLCJ2aXNpdG9yX2lkIjoiNTYxOTkwMTk1OTExMjg1OTQ2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c8a83fb624f8ec324c483eb54c5e8812b534e881f3855724db81584a5a4376da |
| hovercard-subject-tag | issue:2632076539 |
| 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/2502/issue_layout |
| twitter:image | https://opengraph.githubassets.com/84a2f5a04796d76b673564586438d740aeb68fd02a7de9748a376e633421465d/pythonnet/pythonnet/issues/2502 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/84a2f5a04796d76b673564586438d740aeb68fd02a7de9748a376e633421465d/pythonnet/pythonnet/issues/2502 |
| og:image:alt | Environment Pythonnet version: 3.03 Python version: 3.11 Operating System: Windows .NET Runtime:net8.0 Details Describe what you were trying to get done. I am using pythonnet to write a C# project,... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | roywang91 |
| hostname | github.com |
| expected-hostname | github.com |
| None | fdfdce9cd4f6ab85dca2b0d11264270829297c962dd5a79df449062d7822258f |
| 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 | 51c736e60b302bd039c9d5164573d176ceb24bb2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width