py2exe - No system module 'pywintypes'

前端 未结 4 1889
长情又很酷
长情又很酷 2021-02-20 05:33

I\'m trying to convert a simple Python script into a Windows executable. My setup.py script is:

from distutils.core import setup
import py2exe

setup(
    name =         


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-20 06:26

    I recently installed Anaconda, partly because I need the win32com package, and don't want to exclude dll files. However, same problem for me.

    Solution was to copy the DLL files:
    pywintypes27.dll
    pythoncom27.dll
    sitting in:
    C:\Anaconda\Lib\site-packages\win32
    to
    C:\Anaconda\Lib\site-packages\win32\lib

    Because the function looking for those files look there but not in the directory above. Lots of comments in the source file pywintypes.py reveals there has been issues with this, probably due to different install procedures. I have posted an issue on the Anaconda issue tracker here.

提交回复
热议问题