網(wǎng)站首頁 編程語言 正文
pyinstaller打包exe時(shí)報(bào)錯(cuò)問題記錄[makespec options not valid when a.spec file is given]
作者:小宋同學(xué)-- 更新時(shí)間: 2023-12-13 編程語言一、簡(jiǎn)介
最近用pyautogui庫寫了一個(gè)自動(dòng)化操作的小程序,為了提高識(shí)別效率,使用了confidence參數(shù),代碼為xy = pyautogui.locateCenterOnScreen(p,grayscale= False,confidence=0.8)
,其中p為待識(shí)別圖片參數(shù),confidence:表示灰度值。程序完成后運(yùn)行沒有異常,然后封裝時(shí)出現(xiàn)一些問題,下面列出兩個(gè)主要的BUG。
二、報(bào)錯(cuò)問題
1. 報(bào)出錯(cuò)誤【makespec options not valid when a.spec file is given】
因程序中引用多張圖片資源,故封裝時(shí)參照該篇博客打包https://blog.csdn.net/xue_11/article/details/117923245
使用指令為pyi-makespec -F test.py
第一步生成spec文件pyinstaller -F test.spec
第二步常規(guī)打包為exe文件
在運(yùn)行第二步時(shí)就報(bào)出makespec options not valid when a.spec file is given錯(cuò)誤
解決方法:將-F
去掉封裝成功
2. 報(bào)出錯(cuò)誤【NotImplementedError: The confidence keyword argument is only available if OpenCV is install】
封裝成功后,運(yùn)行嘗試,想不到閃退,仔細(xì)看才發(fā)現(xiàn)是報(bào)出NotImplementedError: The confidence keyword argument is only available if OpenCV is install
,大致意思是“confidence關(guān)鍵字參數(shù)僅在OpenCV安裝時(shí)可用”,問了一個(gè)大佬,才發(fā)現(xiàn)是Pyinstaller與OpenCV版本沖突所致。
解決辦法:將原版本的OpenCV卸載,重新安裝OpenCV4.5.3.56解決
安裝命令:pip install opencv-python==4.5.3.56
原文鏈接:https://blog.csdn.net/xue_11/article/details/128765956
- 上一篇:沒有了
- 下一篇:沒有了
相關(guān)推薦
- 2023-04-06 C語言如何實(shí)現(xiàn)循環(huán)輸入_C 語言
- 2022-06-20 正則表達(dá)式之字符串模式匹配實(shí)例詳解_正則表達(dá)式
- 2022-07-02 如何對(duì)numpy?矩陣進(jìn)行通道間求均值_python
- 2022-08-25 python并發(fā)場(chǎng)景鎖的使用方法_python
- 2022-08-19 python項(xiàng)目中requirements.txt的用法實(shí)例教程_python
- 2023-10-11 MP、MybatisPlus、聯(lián)表查詢、自定義sql、Constants.WRAPPER、ew (一
- 2022-10-16 QT編寫tcp通信工具(Client篇)_C 語言
- 2022-04-02 ?Python錯(cuò)誤與異常處理_python
- 欄目分類
-
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運(yùn)行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲(chǔ)小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運(yùn)算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯(cuò)誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實(shí)現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡(jiǎn)單動(dòng)態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對(duì)象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊(duì)列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支