当前位置:网站首页>Pyinstaller packaging scene
Pyinstaller packaging scene
2022-07-22 19:54:00 【A coder who climbs a pit】
First installation pyinstaller
pip install pyinstaller
The effect we want : Click on EXE file , And then run scrapy Program , Which is running EXE It's time to execute this order
scrapy crawl Reptile name
The first way ( It doesn't seem to work , But it's easy to think of )
scrapy Provides a module
cmdline
, We can start withscrapy
Projectscrapy.cfg
Under the same category , Create acrawl.py
file , It writes crawler commandsfrom scrapy import cmdline cmdline.execute("scrapy crawl name ".split())
And then use
pyinstaller
packagepyinstaller crawl.py
Click on the run EXE file , stay dist/crawl, Delete appears , There should be an error , We can EXE Drag the file into
cmd
Inside , In this way, you can check the errors , Anyway, there have been various mistakes , Not solve , I gave up this method .
The second way ( recommend )
Also in
crawl.py
Write code in the file , But the code is differentfrom scrapy.crawler import CrawlerProcess from scrapy.utils.project import get_project_settings process = CrawlerProcess(get_project_settings()) process.crawl('scientist') process.start()
And then use
pyinstaller
packagepyinstaller crawl.py
function EXE Flash back , It should be a mistake , Drag directly into
cmd
, Found an error xxx Module does not exist , You can have a look dist/crawl Is there less module inside , It is found that there is really no such module , Then we can go Python Copy one from the environment .Then run it again
边栏推荐
- Why choose b+ tree for index
- Jiayuan "great earthquake" of the century
- Dnsmasq installation and configuration
- Spark RDD算子:RDD分区,HashPartitioner、RangePartitioner、自定义分区
- C regular expression extracts the index position where the specified word appears
- 从数据标准到数据库设计:解决基础数据标准落地的最后一公里难题(下)
- 常用性能工具:工欲善其事,必先利其器
- 安装mariadb 10.5.7(tar包安装)
- Spark RDD的依赖于DAG的工作原理
- MySQL创建分区表,并按天自动分区
猜你喜欢
ZABBIX realizes nail monitoring alarm
常用性能工具:工欲善其事,必先利其器
How does ZABBIX create a template that only monitors the status of a port
MySQL converts milliseconds into time string
ZABBIX server downtime report "\u zbx\u mem\u malloc(): out of memory (requested 96 bytes)"
jvm的jps简单使用
NewSQL数据库数据模型设计
Polymorphism
Reliability and repeatability of messages
zabbix怎样自定义mysql监控项并触发告警
随机推荐
Dp4361 domestic six channel stereo d/a audio converter chip replaces cs4361
JVM jhat (virtual machine heap dump snapshot analysis tool)
Spark RDD的依赖于DAG的工作原理
基础类型
C语言程序设计代码
Ci24r1 low-cost 2.4G wireless transceiver chip replaces xn297 compact si24r1
Yii2 composer reports an error to solve the problem of requires bower asset
Initial experience of MariaDB spider sharding engine
warning: [mariadbmon] The current master server ‘srv-cls01-02‘ is no longer valid because it is in r
文献记录(part109)--Self-Representation Based Unsupervised Exemplar Selection in a Union of Subspaces
oracle怎样将字符串转为多行
No code coverage driver is available
zabbix怎样自定义mysql监控项并触发告警
作为初学者,我表示不想使用ESLint
Data architecture and database modeling
spinning
Spark SQL 内置函数和自定义函数UDF
ansible简单使用示例
Shell counts all strings before the last occurrence of a string
NewSQL数据库数据模型设计