Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DllNotFoundException:Could not load python311.dll#2580

roywang91 started this conversation inGeneral
Discussion options

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 Chinese path.When
    PythonEngine.Initialize(),Rethrow as DllNotFoundException: Could not load D:/Test中文/v2647_Debug/StreamingAssets/python-3.11.3-
    embed-amd64/python311.dll.If it is a non-Chinese path, everything works fine.

  • What commands did you run to trigger this issue? If you can provide a

varpythonHome= $"{Application.streamingAssetsPath}/{PythonFolder}";varpythonPath=string.Join(";",      $"{pythonHome}/Lib/site-packages",      $"{pythonHome}/{PythonZip}",      $"{pythonHome}"  );varscripts= $"{pythonHome}/Scripts";varpath=Environment.GetEnvironmentVariable("PATH")?.TrimEnd(';');path=string.IsNullOrEmpty(path) ? $"{pythonHome};{scripts}" : $"{pythonHome};{scripts};{path}";Environment.SetEnvironmentVariable("PATH",path,EnvironmentVariableTarget.Process);Environment.SetEnvironmentVariable("DYLD_LIBRARY_PATH", $"{pythonHome}/Lib",EnvironmentVariableTarget.Process);Environment.SetEnvironmentVariable("PYTHONNET_PYDLL", $"{pythonHome}/{PythonDll}",EnvironmentVariableTarget.Process);PythonEngine.PythonHome=pythonHome;PythonEngine.PythonPath=pythonPath;Runtime.PythonDLL=  $"{pythonHome}/{PythonDll}";PythonEngine.Initialize();
  • If there was a crash, please include the traceback here.
Win32Exception:找不到指定的模块RethrowasDllNotFoundException:CouldnotloadD:/USD_中文/USD_中文/UnityApp/FactoryStream_Data/StreamingAssets/python-3.11.3-embed-amd64/python311.dll.atPython.Runtime.Platform.WindowsLoader.Load (System.StringdllToLoad) [0x00037]in<e6978fb1f69f4558807e0a3431702c70>:0atPython.Runtime.Runtime+Delegates.GetUnmanagedDll (System.StringlibraryName) [0x00009]in<e6978fb1f69f4558807e0a3431702c70>:0atPython.Runtime.Runtime+Delegates..cctor () [0x0000a]in<e6978fb1f69f4558807e0a3431702c70>:0RethrowasTypeInitializationException:The typeinitializerfor'Delegates'threwanexception.atPython.Runtime.Runtime.PyGILState_Ensure () [0x00000]in<e6978fb1f69f4558807e0a3431702c70>:0atPython.Runtime.PythonEngine.AcquireLock () [0x00000]in<e6978fb1f69f4558807e0a3431702c70>:0atPython.Runtime.Py+GILState..ctor () [0x00006]in<e6978fb1f69f4558807e0a3431702c70>:0atPython.Runtime.Py.GIL () [0x00007]in<e6978fb1f69f4558807e0a3431702c70>:0atFSM.USD.UsdEngine.Init () [0x00000]in<409251060049431d992f8d5358cc24fc>:0atFSM.USD.UsdEngine..ctor () [0x00006]in<409251060049431d992f8d5358cc24fc>:0at (wrappermanaged-to-native)System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,object,object[],System.Exception&)atSystem.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Objectobj,System.Object[]parameters,System.BooleanwrapExceptions) [0x00005]in<321eb2db7c6d43ea8fc39b54eaca3452>:0RethrowasTargetInvocationException:Exceptionhasbeenthrownbythetargetofaninvocation.atSystem.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Objectobj,System.Object[]parameters,System.BooleanwrapExceptions) [0x0001a]in<321eb2db7c6d43ea8fc39b54eaca3452>:0atSystem.RuntimeType.CreateInstanceMono (System.BooleannonPublic,System.BooleanwrapExceptions) [0x00095]in<321eb2db7c6d43ea8fc39b54eaca3452>:0atSystem.RuntimeType.CreateInstanceSlow (System.BooleanpublicOnly,System.BooleanwrapExceptions,System.BooleanskipCheckThis,System.BooleanfillCache) [0x00009]in<321eb2db7c6d43ea8fc39b54eaca3452>:0atSystem.RuntimeType.CreateInstanceDefaultCtor (System.BooleanpublicOnly,System.BooleanskipCheckThis,System.BooleanfillCache,System.BooleanwrapExceptions,System.Threading.StackCrawlMark&stackMark) [0x00027]in<321eb2db7c6d43ea8fc39b54eaca3452>:0atSystem.Activator.CreateInstance[T] () [0x00015]in<321eb2db7c6d43ea8fc39b54eaca3452>:0atSingleton`1[T]..cctor () [0x00000]in<409251060049431d992f8d5358cc24fc>:0RethrowasTypeInitializationException:The typeinitializerfor'Singleton`1'threwanexception.atProtocolMgrWPF.ImportModelFromCloudLibraryByWpf (SharedMemoryLib.IMsgmsg) [0x00197]in<409251060049431d992f8d5358cc24fc>:0atProtocolMgrWPF.ImportResourceByPathByWPF (SharedMemoryLib.IMsgmessage) [0x00052]in<409251060049431d992f8d5358cc24fc>:0atNetManager.MessageUpdate () [0x000ba]in<409251060049431d992f8d5358cc24fc>:0atNetManager.FixedUpdate () [0x00000]in<409251060049431d992f8d5358cc24fc>:0

Greetings!

You must be logged in to vote

Replies: 1 comment

Comment options

你把中文目录改成英文试一下,

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@roywang91@itmeicn
Converted from issue

This discussion was converted from issue #2502 on April 11, 2025 04:57.


[8]ページ先頭

©2009-2025 Movatter.jp