python - Pyintaller打包基于scrapy的爬虫出错
PHPz
PHPz 2017-04-17 17:28:38
0
2
538

这是一个windows下带GUI的python爬虫

选项 描述
OS Windows 7 x64
python 2.7.6
IDE PyCharm
GUI PyQt4
爬虫 基于scrapy框架实现
打包 Pyinstaller

使用两个进程,父进程是GUI,子进程运行爬虫。

问题:在PyCharm下能成功运行爬虫并实现了所有功能,然而当我使用Pyinstaller将工程打包能独立运行的.exe文件后,双击.exe运行出现以下问题,然而,这个问题在PyCharm下是不存在的。

文件树如下:

installer.py是使用Pyintaller打包工程的:

import os
if __name__=='__main__':
    from PyInstaller.__main__ import run
    opts=['-c','-F','main.py',
          '-p', r'D:\Program Files\Python 2.7.6\Lib\site-packages\scrapy;'
                r'D:\Program Files\Python 2.7.6\Lib\site-packages\scrapy\utils']
    run(opts)

我尝试了很多方法,依然没有解决,希望各位大神帮我分析分析。感谢!

PHPz
PHPz

学习是最好的投资!

reply all(2)
洪涛

Personally, I feel that packaging the scrapy crawler into an exe is a false proposition.
Because the crawler is executed using scrapy cwal *, scrapy.exe itself relies on python to run, so...
Let’s use another method of deploying scrapy crawler, I use scrapyd.

I pray for a powerful answer.

伊谢尔伦

I have been doing this recently and encountered a similar problem. Have you solved it? Please help~~

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template