Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

启动报动态链接库错误! #17

Open
seokmin2024 opened this issue Sep 27, 2024 · 11 comments
Open

启动报动态链接库错误! #17

seokmin2024 opened this issue Sep 27, 2024 · 11 comments

Comments

@seokmin2024
Copy link

C:\Windows\system32>MaaDebugger
Traceback (most recent call last):
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Lib\site-packages\maa\library.py", line 33, in open
Library.framework = lib_import(str(Library.framework_libpath))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\醉染西城\AppData\Local\Programs\Python\Python311\Lib\ctypes_init_.py", line 376, in init
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 1114] 动态链接库(DLL)初始化例程失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Scripts\MaaDebugger.exe_main
.py", line 4, in
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Lib\site-packages\MaaDebugger\main.py", line 3, in
from .webpage import index_page
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Lib\site-packages\MaaDebugger\webpage\index_page_init
.py", line 3, in
from .master_control import main as master_control
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Lib\site-packages\MaaDebugger\webpage\index_page\master_control.py", line 5, in
from maa.define import MaaWin32ScreencapMethodEnum, MaaWin32InputMethodEnum
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Lib\site-packages\maa_init_.py", line 8, in
ver = Library.open(_PATH)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXXX\AppData\Local\Programs\Python\Python311\Lib\site-packages\maa\library.py", line 36, in open
Library.framework = lib_import(str(Library.framework_libpath))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXX\AppData\Local\Programs\Python\Python311\Lib\ctypes_init
.py", line 376, in init
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Could not find module 'None' (or one of its dependencies). Try using the full path with constructor syntax.

@MistEO
Copy link
Member

MistEO commented Sep 28, 2024

装一下运行库试试 vc_redist

@MakoCoreleone
Copy link

MakoCoreleone commented Sep 30, 2024

这个问题我也碰到了,装了运行库以后也没用,MaaFW从v1.8.9更新上来以后就一直报这个错误。uninstall MaaFW MaaDebugger MaaAgentBinary以后重新安装也没用

@MakoCoreleone
Copy link

C:\Users\llyx>python -m MaaDebugger
Traceback (most recent call last):
File "D:\Study\Anaconda\lib\site-packages\maa\library.py", line 33, in open
Library.framework = lib_import(str(Library.framework_libpath))
File "D:\Study\Anaconda\lib\ctypes_init_.py", line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 1114] 动态链接库(DLL)初始化例程失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Study\Anaconda\lib\runpy.py", line 196, in run_module_as_main
return run_code(code, main_globals, None,
File "D:\Study\Anaconda\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "D:\Study\Anaconda\lib\site-packages\MaaDebugger_main
.py", line 1, in
from .main import main
File "D:\Study\Anaconda\lib\site-packages\MaaDebugger\main.py", line 3, in
from .webpage import index_page
File "D:\Study\Anaconda\lib\site-packages\MaaDebugger\webpage\index_page_init
.py", line 3, in
from .master_control import main as master_control
File "D:\Study\Anaconda\lib\site-packages\MaaDebugger\webpage\index_page\master_control.py", line 5, in
from maa.define import MaaWin32ScreencapMethodEnum, MaaWin32InputMethodEnum
File "D:\Study\Anaconda\lib\site-packages\maa_init.py", line 8, in
ver = Library.open(_PATH)
File "D:\Study\Anaconda\lib\site-packages\maa\library.py", line 36, in open
Library.framework = lib_import(str(Library.framework_libpath))
File "D:\Study\Anaconda\lib\ctypes_init
.py", line 374, in init
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'None' (or one of its dependencies). Try using the full path with constructor syntax.

@JZPPP
Copy link

JZPPP commented Nov 4, 2024

遇到相同错误
系统win11 conda环境 python 3.9 3.12均报同样错误
但是 3.10 可以使用,供参考

@Suxiaobai666
Copy link

我也遇到了这样的问题,原本用着是没问题的,但是中途下载安装了miniconda之类的东西来训练模型,训练好之后想继续做,就也出现了 启动报动态链接库错误 的报错:
Traceback (most recent call last):
File "D:\miniconda3\lib\site-packages\maa\library.py", line 33, in open
Library.framework = lib_import(str(Library.framework_libpath))
File "D:\miniconda3\lib\ctypes_init_.py", line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 1114] 动态链接库(DLL)初始化例程失败。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\miniconda3\lib\runpy.py", line 197, in run_module_as_main
return run_code(code, main_globals, None,
File "D:\miniconda3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "D:\miniconda3\lib\site-packages\MaaDebugger_main
.py", line 1, in
from .main import main
File "D:\miniconda3\lib\site-packages\MaaDebugger\main.py", line 3, in
from .webpage import index_page
File "D:\miniconda3\lib\site-packages\MaaDebugger\webpage\index_page_init
.py", line
3, in
from .master_control import main as master_control
File "D:\miniconda3\lib\site-packages\MaaDebugger\webpage\index_page\master_control.py"
, line 5, in
from maa.define import MaaWin32ScreencapMethodEnum, MaaWin32InputMethodEnum
File "D:\miniconda3\lib\site-packages\maa_init.py", line 8, in
ver = Library.open(_PATH)
File "D:\miniconda3\lib\site-packages\maa\library.py", line 36, in open
Library.framework = lib_import(str(Library.framework_libpath))
File "D:\miniconda3\lib\ctypes_init
.py", line 374, in init
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'None' (or one of its dependencies). Try using t
he full path with constructor syntax.

@MistEO
Copy link
Member

MistEO commented Dec 8, 2024

试试更新 maafw 到 2.3.0

@Oarwind
Copy link

Oarwind commented Dec 13, 2024

我也是这个问题,maafw==2.3.0或者2.3.1都报错
PS C:\Users\XXXXX\MAA> python -m MaaDebugger
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\XXXXX\anaconda3\Lib\site-packages\MaaDebugger_main
.py", line 1, in
from .main import main
File "C:\Users\XXXXX\anaconda3\Lib\site-packages\MaaDebugger\main.py", line 3, in
from .webpage import index_page
File "C:\Users\XXXXX\anaconda3\Lib\site-packages\MaaDebugger\webpage\index_page_init
.py", line 3, in
from .master_control import main as master_control
File "C:\Users\XXXXX\anaconda3\Lib\site-packages\MaaDebugger\webpage\index_page\master_control.py", line 5, in
from maa.define import MaaWin32ScreencapMethodEnum, MaaWin32InputMethodEnum
File "C:\Users\XXXXX\anaconda3\Lib\site-packages\maa_init_.py", line 12, in
Library.open(_PATH)
File "C:\Users\XXXXX\anaconda3\Lib\site-packages\maa\library.py", line 30, in open
Library.framework = lib_import(str(Library.framework_libpath))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXXXX\anaconda3\Lib\ctypes_init
.py", line 376, in init
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 1114] 动态链接库(DLL)初始化例程失败

@MistEO
Copy link
Member

MistEO commented Dec 13, 2024

python 自带的 vc redist 版本太老了,参考 MaaXYZ/MaaFramework#361 (comment) 把 python 自带的覆盖掉

@shadowsouls
Copy link

在anaconda里面新建个环境再安装就好了,在旧环境里面加dll貌似也没啥用

@Oarwind
Copy link

Oarwind commented Dec 15, 2024

(base) PS C:\Users\XXXXX> conda activate debugger_env
(debugger_env) PS C:\Users\XXXXX> $env:PATH = "C:\Users\XXXXX\test_dll;" + $env:PATH
(debugger_env) PS C:\Users\XXXXX> ls C:\Users\XXXXX\test_dll


    目录: C:\Users\XXXXX\test_dll


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----          2002/2/1     18:02         449616 msvcp140.dll
-a----          2002/2/1     18:02          91112 vcruntime140.dll


(debugger_env) PS C:\Users\XXXXX> python -m MaaDebugger
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\XXXXX\anaconda3\Lib\site-packages\MaaDebugger\__main__.py", line 1, in <module>
    from .main import main
  File "C:\Users\XXXXX\anaconda3\Lib\site-packages\MaaDebugger\main.py", line 3, in <module>
    from .webpage import index_page
  File "C:\Users\XXXXX\anaconda3\Lib\site-packages\MaaDebugger\webpage\index_page\__init__.py", line 3, in <module>
    from .master_control import main as master_control
  File "C:\Users\XXXXX\anaconda3\Lib\site-packages\MaaDebugger\webpage\index_page\master_control.py", line 5, in <module>
    from maa.define import MaaWin32ScreencapMethodEnum, MaaWin32InputMethodEnum
  File "C:\Users\XXXXX\anaconda3\Lib\site-packages\maa\__init__.py", line 12, in <module>
    Library.open(__PATH)
  File "C:\Users\XXXXX\anaconda3\Lib\site-packages\maa\library.py", line 30, in open
    Library.framework = lib_import(str(Library.framework_libpath))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\XXXXX\anaconda3\Lib\ctypes\__init__.py", line 376, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 1114] 动态链接库(DLL)初始化例程失败。

两个dll文件放进maaframework.dll同文件夹,甚至还开了一个test_dll专门放这两个文件添加进环境变量,还是不行
屏幕截图 2024-12-15 124157
屏幕截图 2024-12-15 124142

@Oarwind
Copy link

Oarwind commented Dec 23, 2024

我这两天拿Process Explorer看了一下调的到底是哪个.dll,最后发现是C:\Users\XXXX\anaconda3下面的.dll,替换掉这两个就可以了
附上一张Process Explorer的截图:
屏幕截图 2024-12-23 145130
算是提供一个笨办法吧orz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants