mhammond / pywin32

Python for Windows (pywin32) Extensions
5.01k stars 792 forks source link

ImportError: DLL load failed while importing win32crypt #2140

Closed JustLmr closed 6 months ago

JustLmr commented 11 months ago

the error here is giving an error when importing the win32crypt module I have done almost everything I can do to help please

his error:

Microsoft Windows [Version 10.0.22621.2428]
(c) Microsoft Corporation. Tüm hakları saklıdır.

C:\Users\Emire\Desktop\malware\build\exe.win-amd64-3.11>scx.exe
Traceback (most recent call last):
  File "C:\Users\Emire\AppData\Local\Programs\Python\Python311\Lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 124, in run
    module_init.run(name + "__main__")
  File "C:\Users\Emire\AppData\Local\Programs\Python\Python311\Lib\site-packages\cx_Freeze\initscripts\console.py", line 16, in run
    exec(code, module_main.__dict__)
  File "scx.py", line 17, in <module>
ImportError: DLL load failed while importing win32crypt: Belirtilen modül bulunamadı.

Setup.py:

from cx_Freeze import setup, Executable

build_exe_options = {
    "includes": ["pywin32"],
}

setup(
    name="myscript",
    version="1.0",
    description="My Script",
    options={"build_exe": build_exe_options},
    executables=[Executable("myscript.py")]
)
mhammond commented 11 months ago

If it works for you with a plain Python + pywin32 install I suspect something will be wrong in your freeze environment - ie, that you might not be trying to load the win32crypt.pyd you think you are.

Avasam commented 6 months ago

That being said, I do have concerns about your project folder being called "malware" and trying to freeze it into an executable file. And your only GitHub project being the same filename that is a Discord-based info-grabber.

Avasam commented 6 months ago

Punting this off as a cx_Freeze issue. There's many other related issues anyway.