在Mac OS上使用Pyinstaller与Gooey打包Scrapy Project

时间:2019-01-21 19:15:29

标签: python macos scrapy pyinstaller

我有一个带有Gooey前端的Scrapy项目,我想将其打包在可发行的macOS中。我有一个runner.py调用点来运行搜寻器,但为MacO打包它似乎很困难。我在Windows上为PyInstaller制作了build.spec工作正常),但Mac上的build.spec似乎并没有打包所有东西。它确实创建了可执行程序,但是不起作用。 这是spec文件:

import gooey
gooey_root = os.path.dirname(gooey.__file__)
gooey_languages = Tree(os.path.join(gooey_root, 'languages'), prefix = 'gooey/languages')
gooey_images = Tree(os.path.join(gooey_root, 'images'), prefix = 'gooey/images')
a = Analysis(scripts=['runner.py'],
             pathex=['/Library/Frameworks/Python.framework/Versions/2.7/bin', '/Library/Frameworks/Python.framework/Versions/2.7/lib'],
             binaries=[('/System/Library/Frameworks/Tk.framework/Tk', 'tk'),
               ('/System/Library/Frameworks/Tcl.framework/Tcl', 'tcl')],
             hiddenimports=['SearchEngineScrapy.spiders.searchenginespider'],
             hookspath=['hooks/'],
             runtime_hooks=[],
             excludes=[],
             datas=[('SearchEngineScrapy/spiders','./spiders'), ('SearchEngineScrapy/utils','./utils'),
                    ('SearchEngineScrapy/settings.py','./settings.py'), ('SearchEngineScrapy/items.py','./items.py'),
                    ('SearchEngineScrapy/middlewares.py','./middlewares.py'), ('SearchEngineScrapy/pipelines.py','./pipelines.py'),
                    ('scrapy.cfg','.')
                   ]
             )
pyz = PYZ(a.pure, a.binaries, a.zipped_data)

options = [('u', None, 'OPTION'), ('v', None, 'OPTION'), ('w', None, 'OPTION')]

exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          options,
          gooey_languages, # Add them in to collected files
          gooey_images, # Same here.
          name='SearchEngineScrapy',
          debug=True,
          strip=None,
          upx=False,
          console=False,
          windowed=True)

请让我知道我在这里想念的东西。我应该添加些什么以使其能够正常工作的应用程序分发。

0 个答案:

没有答案
相关问题