打包paddleocr時,出現(xiàn)Error: Can not import avx core while this file exists: xxxxxx(你安裝Python的徑)\paddle2.0\lib\site-packages\paddle\fluid\core_avx.pyd錯誤: 解決方法:進入paddle安裝對應(yīng)的虛擬環(huán)境下,如下圖所示,找到paddle/libs,如下所示: Copy所有的dll文件到dist下的: pyinstaller可執(zhí)行文件報錯astor: 解決方法: 注銷這三行。重新打包。 或者通過降低astor的版本:目前電腦上0.8.1,降到0.7.1即可。 3.打包中出現(xiàn):SyntaxError: (unicode error) 'unicodeescape’ codec can’t decode bytes in position 2-3: truncated \UXXXXXXXX escape編碼問題,是路徑轉(zhuǎn)義問題,只需要把反斜杠’\’改為正斜杠’/’即可。 打包paddleoce為exe文件出現(xiàn)錯誤的參考內(nèi)容: https://blog.csdn.net/aqqwvfbukn/article/details/120553124?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163754255816780366519388%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=163754255816780366519388&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~rank_v31_ecpm-1-120553124.pc_search_result_cache&utm_term=%E6%88%90%E5%8A%9F%E8%A7%A3%E5%86%B3-PaddleOCR%E6%89%93%E5%8C%85exe-Pyinstaller&spm=1018.2226.3001.4187 4.遇到importlib.metadata not found from “prettytable”的錯誤:解決方法:在site-packages/Pyinstaller/hooks目錄下增加一個文件:hook-ctypes.macholib.py,內(nèi)容如下。可解決。 from PyInstaller.utils.hooks import copy_metadata datas = copy_metadata('prettytable’) 5.在指定的環(huán)境路徑下打包的方法: pyinstaller network.py -p C:\Users\flysky\PycharmProjects\JMQapp\venv\Lib\site-packages 6.framework_pb2的錯誤:把site_pacages下的proto移到dist\paddle_image\paddle\fluid 7.注意: Python的那個坑爹設(shè)定,不會把項目入口的當(dāng)前目錄當(dāng)做package,所以包與python文件不要放一起。 8.錯誤:File “ppocr\utils\e2e_utils\pgnet_pp_utils.py”, line 25, in ModuleNotFoundError: No module named 'extract_textpoint_slow’的解決方法:把ppocr文件包移到dist目錄下面。 9.錯誤:File “skimage\feature\orb_cy.pyx”, line 13, in init skimage.feature.orb_cy ModuleNotFoundError: No module named 'skimage.feature._orb_descriptor_positions’ 增加spec文件中的hiddenimports=['framework_pb2’,'scipy.special.cython_special’,'skimage’,'skimage.feature._orb_descriptor_positions’], 10.最后把配置文件轉(zhuǎn)到dist文件夾下面。 總結(jié):dll文件、ppocr、配置文件、hidden-import解決,完美! ———————————————— 版權(quán)聲明:本文為CSDN博主「Joyce1001」的原創(chuàng)文章,遵循CC 4.0 BY-SA版權(quán)協(xié)議,轉(zhuǎn)載請附上原文出處鏈接及本聲明。 原文鏈接:https://blog.csdn.net/Joyce1001/article/details/121509765 |
|