当前位置:网站首页>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
边栏推荐
- 老姜的特点
- Avoid playing with super high conversion rate in material minefields
- Since the "epidemic", we have adhered to the "no closing" of data middle office services
- MySQL -- Introduction and use of single line functions
- [common error] custom IP instantiation error
- Functions and arrays of shell scripts
- Day05 表格
- Luogu p1309 Swiss wheel
- C import Xls data method summary III (processing data in datatable)
- Typescript basic knowledge sorting
猜你喜欢

查询效率提升10倍!3种优化方案,帮你解决MySQL深分页问题

在寻求人类智能AI的过程中,Meta将赌注押向了自监督学习

功能:编写函数fun求s=1^k+2^k +3^k + ......+N^k的值, (1的K次方到N的K次方的累加和)。

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

A dichotomy of Valentine's Day

Print diamond pattern

Huawei BFD and NQA

Mobile asynchronous sending SMS verification code solution -efficiency+redis

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

我管你什么okr还是kpi,PPT轻松交给你
随机推荐
Since the "epidemic", we have adhered to the "no closing" of data middle office services
Summary of common tools and technical points of PMP examination
PMP 考试常见工具与技术点总结
leetcode 121 Best Time to Buy and Sell Stock 买卖股票的最佳时机(简单)
Mobile asynchronous sending SMS verification code solution -efficiency+redis
Pratique technique | analyse et solution des défaillances en ligne (Partie 1)
Swagger2 quick start and use
【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示
Oracle database knowledge points that cannot be learned (III)
On covariance of array and wildcard of generic type
Design of database table foreign key
Release and visualization of related data
swagger中响应参数为Boolean或是integer如何设置响应描述信息
File contains vulnerability summary
技术实践|线上故障分析及解决方法(上)
[prefix and notes] prefix and introduction and use
Introduction to thread pool
Print diamond pattern
Who moved my code!
PMP 考试常见工具与技术点总结