-
how to make exe from python file with paddleOCRi am using auto-py-to-exe but i think it will work in pyinstaller too with the same parameters to collect data. install auto-py-to-exefor installing auto-py-to-exe github page: https://github.com/brentvollebregt/auto-py-to-exe select you main file .py and add the paddle dependencies in the Advanced optionsit take me a while to discover this. |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 67 replies
-
In my case, script return "ModuleNotFoundError: No module named 'scipy.io'", but other problems gone - your solution fix it. |
Beta Was this translation helpful? Give feedback.
-
I still find an error after using your method, maybe I should add more file? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Thank you @Heryk13. You solution worked perfectly for me for Python 3.11. Thanks a lot again. |
Beta Was this translation helpful? Give feedback.
-
Thank you, your solution solved my problem. |
Beta Was this translation helpful? Give feedback.
-
Thank you, this method also solved my problem |
Beta Was this translation helpful? Give feedback.
-
After installing your steps, this prompt appears |
Beta Was this translation helpful? Give feedback.
-
This is a great solution, might miss some corner cases with dll files, Tl,DR : |
Beta Was this translation helpful? Give feedback.
-
I tried a build with Pyinstaller with your method and it worked. It created the build without any problem. Unfortunately, when I test the exe created with the build, the execution time is much, much slower. It is so slow that I don't have any output after 30 minutes. When I use my program on runtime python, I start to have ouputs in 10 seconds and the program finish in around 400 s.
If you have any idea why it is doing it. Please, let me know if you have an idea to fix my problem. |
Beta Was this translation helpful? Give feedback.
-
I've created a standalone executable version of PaddleOCR that behaves exactly like the command line version of PaddleOCR when it is installed for example via pip. |
Beta Was this translation helpful? Give feedback.
hey @Edmond-Lee-Zse-Wong i created a exe with your code. here is what i used
code:
`import traceback
import time
try:
from paddleocr import PaddleOCR
ocr = PaddleOCR(use_angle_cls=True, lang="ch") # need to run only once to download and load model into memory
img_path = "img.png"
result = ocr.ocr(img_path, cls=True)
for idx in range(len(result)):
res = result[idx]
for line in res:
print(f"ocrText: {line[1][0]}")
except Exception as e:
traceback.print_exc()
time.sleep(60)
`
i tested in the python versions 3.10.13 and i saw the error scipy, and did what @pikut said.
like this.
and it worked i think you could try in the python version 3.10.13 or 3.9.13 and 3.10.11 that worked for @pikut too.
…