py2exe - No system module 'pywintypes'

前端 未结 4 1891
长情又很酷
长情又很酷 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:13

    Here is a code snippet of my daily use to package console python app to exe. It's works fine.

    from distutils.core import setup
    import py2exe
    from glob import glob
    
    data_files = [("Microsoft.VC90.CRT",
                  glob(r'C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*.*')), 
                 ... other required files]
    py2exe_options={"py2exe":{"includes":[some_thing_need_to_included], 
                              "dll_excludes":[some_thing_need_to_exclude]}}
    setup(data_files=data_files, 
          options=py2exe_options,
          console=['aim_python_script.py'])
    

    You should check the content of your 'simple_script.py'. Does it reference some special third party library?

提交回复
热议问题