当前位置:网站首页>Pyinstaller packaging py script warning:lib not found and other related issues
Pyinstaller packaging py script warning:lib not found and other related issues
2022-07-04 01:19:00 【Programmer base camp】
Use Pyinstaller pack py by exe Since the document , I will always encounter Warning:lib not found And so on , Such as :

Although most of the time , You ignore these like me warning, After packaging exe It can also run . There are a lot of methods on the Internet , It is suggested to install win7 Of , There are also suggestions to change 32 position python Of documents , Prompt to download 2G Size correlation SDK Of . All in all , Namely pyinstaller For the current win10 Not supportive enough ! But these online methods are too expensive , Then don't change win10 X64 System , No change python edition (3.6.4) Under the circumstances , How to use... Gracefully pyinstaller And there is no full screen warning What about the hint ?
After a little groping , Finally found a way ,pyinstaller Prompt these that cannot be found dll file , such as api-ms-win-crt-runtime-l1-1-0.dll Actually stay win10 It also exists in the system , Most of it is in :C:\Windows\System32\downlevel Path and its upper path C:\Windows\System32 Next , Here's the picture :

We only need to add these two paths to the user environment variables .

After adding environment variables ,pyinstaller REPACK py When you file , Will give priority to finding in these paths , You can package it successfully .PS: Remember to log out of the system and log in again , To take effect !
Pack again , The page is much cleaner ,win10 X64 The next test is effective !

PS: It should be noted that , Many times we pyinstaller pack py Although the file shows “ success ”, But really run exe file , Still report a mistake , Such as fail to execute script And so on , The terminal interface often flashes , Many times we can't even see the specific reason with our naked eyes ! Crawling has a stupid way —— Recording screen . Recommend an easy-to-use screen recording software Ocam. The prompt information that seems to flash by the naked eye will be completely recorded by the screen recording software , formation mp4 file , Let's use the pause function of the player , You can locate the error message . Here are a few errors I encountered during execution :


At this time, the problem is simple , such as , The above two figures suggest , A module that cannot be found distuils, A hint: you need to install dependent libraries xlrd. We will distuils Folder from python The file location corresponds to lib Found under file , Put it in our python(env) Under the corresponding folder ,xlrd Directly pip Can be installed .

ps: If what you want to package is quoted like me pandas Library py file , Try not to directly import pandas as pd, It's packed like this exe The file is very large , You can refer to any function you want to use , Such as :
from pandas import read_csv,read_excel,DataFrame,concat
边栏推荐
猜你喜欢

功能:求5行5列矩阵的主、副对角线上元素之和。注意, 两条对角线相交的元素只加一次。例如:主函数中给出的矩阵的两条对角线的和为45。

Infiltration learning diary day19

How to use AHAS to ensure the stability of Web services?

“疫”起坚守 保障数据中台服务“不打烊”
![[prefix and notes] prefix and introduction and use](/img/a6/a75e287ac481559d8f733e6ca3e59c.jpg)
[prefix and notes] prefix and introduction and use

A-Frame虚拟现实开发入门

机器学习基础:用 Lasso 做特征选择

What is the GPM scheduler for go?

Query efficiency increased by 10 times! Three optimization schemes to help you solve the deep paging problem of MySQL

Employees' turnover intention is under the control of the company. After the dispute, the monitoring system developer quietly removed the relevant services
随机推荐
Since the "epidemic", we have adhered to the "no closing" of data middle office services
Fundamentals of machine learning: feature selection with lasso
String hash, find the string hash value after deleting any character, double hash
Logical operator, displacement operator
1-redis architecture design to use scenarios - four deployment and operation modes (Part 1)
swagger中响应参数为Boolean或是integer如何设置响应描述信息
Future source code view -juc series
On covariance of array and wildcard of generic type
The first training of wechat applet
QML add gradient animation during state transition
12. Go implementation of integer to Roman numeral and leetcode
Force deduction solution summary 1189- maximum number of "balloons"
51 single chip microcomputer timer 2 is used as serial port
不得不会的Oracle数据库知识点(四)
How to use AHAS to ensure the stability of Web services?
File contains vulnerability summary
The culprit of unrestrained consumption -- Summary
Function: find the sum of the elements on the main and sub diagonal of the matrix with 5 rows and 5 columns. Note that the elements where the two diagonals intersect are added only once. For example,
C import Xls data method summary I (upload files and create Workbooks)
Summary of common tools and technical points of PMP examination