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

前端 未结 8 718
温柔的废话
温柔的废话 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:47

    Not sure if you're still looking for help on this.

    Errors 1 and 3 look like the same error. This SO question pointed me in the right direction. Essentially, install the MS VC++ 9.0 x64 redistribution package, and that should take care of those errors.

    Error 2 appears to have been taken care of by following Lee's suggestion.

    Error 4 is because, for some reason, PyInstaller stuck some empty file names in your binary list. I'm not sure if there's a less-hacky way to fix the error, but I was able to get around it by putting

    for b in a.binaries:
        if b[0] == '':
            a.binaries.remove(b)
    

    after the Analysis( ... ) block in my spec file.

    I'm not sure if the library python%s%s required via ctypes not found warnings are relevant. They're awfully suspicious, but I went down a rabbit hole trying to figure out where those warnings were generated and only succeeded in wasting about two hours of my evening.

提交回复
热议问题