Pyinstaller - ImportError: No system module 'pywintypes' (pywintypes27.dll)

前端 未结 8 726
温柔的废话
温柔的废话 2021-01-11 18:03

I am trying to package my python script into an executable. I thought I would be pretty straight forward as I don\'t have very many imports. First off here are my imports:

8条回答
  •  情话喂你
    2021-01-11 18:49

    I had a similar problem:

    Traceback (most recent call last):
      File ".\install\pywin32_postinstall.py", line 605, in 
        install()
      File ".\install\pywin32_postinstall.py", line 328, in install
        LoadSystemModule(lib_dir, "pywintypes")
      File ".\install\pywin32_postinstall.py", line 166, in LoadSystemModule
        mod = imp.load_dynamic(modname, filename)
    ImportError: DLL load failed: The specified module could not be found.
    

    My mistake was that I installed pywin32 via pip for user

    pip install pywin32 --user
    

    So the needed DLLs were in user's AppData: %appdata%\Python\Python27\site-packages That's why pywin32_postinstall.py couldn't find them.

    Re-installing without --user option helped.

提交回复
热议问题