J
J
JRazor2014-08-09 20:54:07
Python
JRazor, 2014-08-09 20:54:07

Scrapy to EXE. How?

Hello colleagues.
There was a problem converting Scrapy to .exe file. Tried py2exe and cx_freeze - same error in both cases.
Mistake:

Traceback (most recent call last):
  File "Test2.py", line 4, in <module>
  File "scrapy\__init__.pyo", line 10, in <module>
  File "pkgutil.pyo", line 591, in get_data
IOError: [Errno 2] No such file or directory: 'scrapy\\VERSION'

I searched on the Internet - they say that the problem is in includes, but it includes twisted and scrapy.
Script:
from distutils.core import setup
import py2exe

includes = ['scrapy', 'os', 'twisted']
excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
        'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
        'Tkconstants', 'Tkinter']
packages = []
dll_excludes = ['libgdk-win32-2.0-0.dll', 'libgobject-2.0-0.dll', 'tcl84.dll',
            'tk84.dll']

setup(
    options = {"py2exe": {"compressed": 2, 
                      "optimize": 2,
                      "includes": includes,
                      "excludes": excludes,
                      "packages": packages,
                      "dll_excludes": dll_excludes,
                      "bundle_files": 3,
                      "dist_dir": "dist",
                      "xref": False,
                      "skip_archive": False,
                      "ascii": False,
                      "custom_boot_script": '',
                     }
          },
    windows=['Test2.py']
)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gimntut, 2014-08-10
@gimntut

Run procmon.exe (Process Monitor) and see where the scrapy folder is actually looked for when converting. Most likely not where you expect.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question