当前位置:网站首页>Use pyinstaller to package py files into exe. Precautions and error typeerror:_ get_ sysconfigdata_ name() missing 1...‘ check_ Solutions to exists'
Use pyinstaller to package py files into exe. Precautions and error typeerror:_ get_ sysconfigdata_ name() missing 1...‘ check_ Solutions to exists'
2022-06-27 16:58:00 【zeeq_】
Use pyinstaller, We can easily py The files are packed into exe. The packing order is :
pyinstaller -F -w xxx.py
among :-F The parameter indicates that all contents are packaged into one exe Executable file , There will be no other odd little dependency files .-w The parameter represents the run generated exe When you file , No command line window will pop up , But just pop up what we do GUI. If you don't add this parameter , Open the generated exe When you file , A command line window as shown below will pop up at the same time , Redundant and unsightly :

When packing , There are some problems that need attention :
1 Generated exe File is too large.
This is because pyinstall At the time of packing , Some unused libraries in the current environment will also be packaged , This leads to the generation of exe File is too large. ( A few hundred easy M). The solution is , have access to anaconda perhaps pipenv Create a new virtual environment , Then install only the dependent libraries in this environment , Then run the package command , Generated in this way exe Will be much smaller ( Can be reduced to a few M Dozens of M). For details, please refer to Pyinstaller pack , What if the file is too big ?
2 Report errors TypeError: _get_sysconfigdata_name() missing 1 required positional argument: ‘check_exists’
The solution to this mistake is , Get into python Command line mode , Then execute the following two commands in sequence :
import sysconfig
print(sysconfig.__file__)
You can get sysconfig.py The path to this file , To open it , Then find the _get_sysconfigdata_name function , Will be one of the check_exists The default value of the parameter is set to True. namely _get_sysconfigdata_name(check_exists=True). Then save , Then run the package command , That's all right. . Reference resources Through terminal use Pyinstaller compile python Script
边栏推荐
- 关于#mysql#的问题:问题遇到的现象和发生背景
- Solving Poisson equation by tensorflow
- Data center table reports realize customized statistics, overtime leave summary record sharing
- d3dx9_ Where is 35.dll? d3dx9_ Where can I download 35.dll
- d3dx9_ How to repair 33.dll? d3dx9_ What if 33.dll is lost?
- Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
- 字节跳动埋点数据流建设与治理实践
- 等保三级密码复杂度是多少?多久更换一次?
- Relation and operation of ORM table
- The array of C language is a parameter to pass a pointer
猜你喜欢

Smart wind power | Tupu software digital twin wind turbine equipment, 3D visual intelligent operation and maintenance

Halcon: discrete digital OCR recognition

Oracle concept II

继手机之后 报道称三星也削减了电视等家电产品线的产量

Leetcode daily practice (sum of two numbers)

Unity shadow shadow pancaking

Detailed explanation of various GPIO input and output modes (push-pull, open drain, quasi bidirectional port)

Array represents a collection of several intervals. Please merge all overlapping intervals and return a non overlapping interval array. The array must exactly cover all the intervals in the input. 【Le

字节跳动埋点数据流建设与治理实践

Open source 23 things shardingsphere and database mesh have to say
随机推荐
[fxcg] today's market analysis
What is RPC
Leetcode daily practice (main elements)
A robot is located in the upper left corner of an M x n grid. The robot can only move down or right one step at a time. The robot attempts to reach the lower right corner of the grid. How many differe
d3dx9_ How to repair 33.dll? d3dx9_ What if 33.dll is lost?
国家食品安全风险评估中心:不要盲目片面追捧标签为“零添加”“纯天然”食品
d3dx9_ How to repair 32.dll? d3dx9_ Solution to 32.dll missing
Oracle概念二
Handling of difficult and miscellaneous problems during the installation and configuration of qt5.5.1 desktop version (configuring arm compilation Kit)
logstash排除特定文件或文件夹不采集上报日志数据
Ti Click: quickly set up tidb online laboratory through browser | ti- team interview can be conducted immediately
Pragma once Usage Summary
开源二三事|ShardingSphere 与 Database Mesh 之间不得不说的那些事
等保2.0密码要求是什么?法律依据有哪些?
Etcd可视化工具:Kstone部署(一),基于Helm快速部署
d3dx9_ Where is 35.dll? d3dx9_ Where can I download 35.dll
d3dx9_ How to repair 40.dll? Win10 system d3dx9_ What if 40.dll is lost?
QT5 之信号与槽机制(信号与槽的基本介绍)
National food safety risk assessment center: do not blindly and unilaterally pursue "zero addition" and "pure natural" food
Impressive questions