Can't make standalone binary scrapy spider with cx_Freeze

前端 未结 1 1770
耶瑟儿~
耶瑟儿~ 2021-01-06 02:47

A short description about my working environment: win 7 x64, python 2.7 x64, scrapy 0.22, cx_Freeze 4.3.2.

First, I developed a simple crawl-spider and it works fine

1条回答
  •  清酒与你
    2021-01-06 03:29

    Replace your cx_Freeze code with this.

    import sys 
        from cx_Freeze import setup, Executable 
        build_exe_options = {"packages": ["os","twisted","scrapy","test"], "excludes": ["tkinter"],"include_msvcr":True} 
    
        base = None
        setup(  name = "MyScript", 
                version = "0.1",
                description = "Demo", 
                options = {"build_exe": build_exe_options}, 
                executables = [Executable("C:\\MyScript", base=base)]) 
    

    The difference in code is I have included the whole of the packages so you can access all functions from them.

    0 讨论(0)
提交回复
热议问题