测试发现能够正常工作
pip uninstall lxml
Traceback (most recent call last):
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddle/utils/lazy_import.py", line 32, in try_import
mod = importlib.import_module(module_name)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/premailer/__init__.py", line 1, in <module>
from .premailer import Premailer, transform # noqa
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/premailer/premailer.py", line 12, in <module>
from lxml import etree
ModuleNotFoundError: No module named 'lxml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/greatx/repos/PaddleOCR/tools/test.py", line 11, in <module>
save_structure_res(result, save_folder,os.path.basename(img_path).split('.')[0])
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddleocr/ppstructure/predict_system.py", line 279, in save_structure_res
to_excel(region["res"]["html"], excel_path)
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddleocr/ppstructure/table/predict_table.py", line 153, in to_excel
tablepyxl.document_to_xl(html_table, excel_path)
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddleocr/ppstructure/table/tablepyxl/tablepyxl.py", line 118, in document_to_xl
wb = document_to_workbook(doc, base_url=base_url)
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddleocr/ppstructure/table/tablepyxl/tablepyxl.py", line 93, in document_to_workbook
try_import("premailer")
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddle/utils/lazy_import.py", line 41, in try_import
raise ImportError(err_msg)
ImportError: Failed importing premailer. This likely means that some paddle modules require additional dependencies that have to be manually installed (usually with `pip install premailer`).
pip uninstall premailer
Traceback (most recent call last):
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddle/utils/lazy_import.py", line 32, in try_import
mod = importlib.import_module(module_name)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'premailer'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/greatx/repos/PaddleOCR/tools/test.py", line 11, in <module>
save_structure_res(result, save_folder,os.path.basename(img_path).split('.')[0])
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddleocr/ppstructure/predict_system.py", line 279, in save_structure_res
to_excel(region["res"]["html"], excel_path)
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddleocr/ppstructure/table/predict_table.py", line 153, in to_excel
tablepyxl.document_to_xl(html_table, excel_path)
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddleocr/ppstructure/table/tablepyxl/tablepyxl.py", line 118, in document_to_xl
wb = document_to_workbook(doc, base_url=base_url)
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddleocr/ppstructure/table/tablepyxl/tablepyxl.py", line 93, in document_to_workbook
try_import("premailer")
File "/home/greatx/repos/PaddleOCR/venv/lib/python3.10/site-packages/paddle/utils/lazy_import.py", line 41, in try_import
raise ImportError(err_msg)
ImportError: Failed importing premailer. This likely means that some paddle modules require additional dependencies that have to be manually installed (usually with `pip install premailer`).