Paddleocr conflict, please kindly help

AttributeError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).

Traceback:

File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)File "/app/npd/bsh_pdt_page3.py", line 33, in <module>
    from paddleocr import PaddleOCR, draw_ocr# Paddleocr目前支持中英文、英文、法语、德语、韩语、日语,可以通过修改lang参数进行切换   # 参数依次为`ch`, `en`, `french`, `german`, `korean`, `japan`。File "/home/appuser/venv/lib/python3.9/site-packages/paddleocr/__init__.py", line 14, in <module>
    from .paddleocr import *File "/home/appuser/venv/lib/python3.9/site-packages/paddleocr/paddleocr.py", line 25, in <module>
    import cv2File "/home/appuser/venv/lib/python3.9/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()File "/home/appuser/venv/lib/python3.9/site-packages/cv2/__init__.py", line 175, in bootstrap
    if __load_extra_py_code_for_module("cv2", submodule, DEBUG):File "/home/appuser/venv/lib/python3.9/site-packages/cv2/__init__.py", line 28, in __load_extra_py_code_for_module
    py_module = importlib.import_module(module_name)File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)File "/home/appuser/venv/lib/python3.9/site-packages/cv2/gapi/__init__.py", line 290, in <module>
    cv.gapi.wip.GStreamerPipeline = cv.gapi_wip_gst_GStreamerPipeline

I have no familiarity with that package, so I don’t have any specifics for you. However, you will want to make sure your environment is configured correctly.

  1. Make sure that you aren’t using multiple different files to manage Python packages. (I recommend using requirements.txt to manage Python packages with pip.)
  2. Make sure anything that needs to be installed that isn’t a Python package is listed in packages.txt

You can always trim your main file to just a few lines to check what’s installed and see how the environment resolved like:

import streamlit as st
import os

pip = os.popen('pip list').read()
st.code(pip,language=None)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.