PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.37k stars 7.83k forks source link

我在使用apache+wsgi windows11 部署python flask项目 paddleocr import 报错 #11613

Closed szhllyyl closed 5 months ago

szhllyyl commented 9 months ago
  1. Paddle:paddlepaddle-gpu 2.6.0.post116
  2. PaddleOCR:2.7.0.3
  3. apache : 2.5.4(win64)
  4. python : 3.10
  5. mod_wsgi : 4.9.2

Apache错误消息:

[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]   File "D:\\mytest\\mytest.py", line 10, in <module>\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]     from IDCARD import main\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]   File "D:\\mytest\\IDCARD.py", line 2, in <module>\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]     from paddleocr import PaddleOCR\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]   File "D:\\ProgramData\\Anaconda3\\envs\\rec_ID_gpu\\lib\\site-packages\\paddleocr\\__init__.py", line 14, in <module>\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]     from .paddleocr import *\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]   File "D:\\ProgramData\\Anaconda3\\envs\\rec_ID_gpu\\lib\\site-packages\\paddleocr\\paddleocr.py", line 21, in <module>\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]     import paddle\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]   File "D:\\ProgramData\\Anaconda3\\envs\\rec_ID_gpu\\lib\\site-packages\\paddle\\__init__.py", line 28, in <module>\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]     from .base import core  # noqa: F401\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]   File "D:\\ProgramData\\Anaconda3\\envs\\rec_ID_gpu\\lib\\site-packages\\paddle\\base\\__init__.py", line 39, in <module>\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]     from . import framework\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]   File "D:\\ProgramData\\Anaconda3\\envs\\rec_ID_gpu\\lib\\site-packages\\paddle\\base\\framework.py", line 37, in <module>\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]     from .. import pir\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]   File "D:\\ProgramData\\Anaconda3\\envs\\rec_ID_gpu\\lib\\site-packages\\paddle\\pir\\__init__.py", line 37, in <module>\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]     from . import core  # noqa: F401\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]   File "D:\\ProgramData\\Anaconda3\\envs\\rec_ID_gpu\\lib\\site-packages\\paddle\\pir\\core.py", line 23, in <module>\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]     from ..base import unique_name\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]   File "D:\\ProgramData\\Anaconda3\\envs\\rec_ID_gpu\\lib\\site-packages\\paddle\\base\\unique_name.py", line 17, in <module>\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]     from .wrapped_decorator import signature_safe_contextmanager\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]   File "D:\\ProgramData\\Anaconda3\\envs\\rec_ID_gpu\\lib\\site-packages\\paddle\\base\\wrapped_decorator.py", line 17, in <module>\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460]     import decorator\r
[Wed Feb 21 17:19:52.818357 2024] [wsgi:error] [pid 32384:tid 1308] [client ::1:10460] ModuleNotFoundError: No module named 'decorator'\r
changdazhou commented 9 months ago

需要单独安装一下decorator哈,pip install decorator