2

Good morning, I have been trying to install paddleOCR(https://github.com/PaddlePaddle/PaddleOCR) with anaconda and I tried to start it with the command line at cmd and it works fine:

(paddle_env) C:\OCR>paddleocr --image_dir source/test.png --use_angle_cls true --lang en

But when I try to do it by code:

from paddleocr import PaddleOCR,draw_ocr
ocr = PaddleOCR(use_angle_cls=True, lang='en') # need to run only once to download and load model into memory
img_path = './source/test.jpg'
result = ocr.ocr(img_path, cls=True)
for line in result:
    print(line)

I get the next error like if the library of paddle was not installed but it is. So I'm not guessing which is the error:

  File "C:\OCR\required\ocr.py", line 1, in <module>
    from paddleocr import PaddleOCR,draw_ocr
ModuleNotFoundError: No module named 'paddleocr'

In both executions I'm using the same env.

Thank you for your help.

  • Try via anaconda prompt [link](https://pypi.org/project/paddleocr/), you can cross-check by doing a pip list/freeze – Agnij Sep 25 '21 at 08:02
  • Hello @Agnij, I just tried but it's not working, I have tried before too, the error it's the same. In pip list it shows me that it's actually installed. "paddleocr 2.3.0.1 paddlepaddle 2.1.3" – Daniel García Sep 25 '21 at 08:11
  • Are you still facing it? Have you tried !pip install paddleocr in Anaconda? – Esraa Abdelmaksoud Mar 24 '22 at 02:34

3 Answers3

2

Try this prompt command:

pip install "paddleocr>=2.0.1"

Link to documentation: https://pypi.org/project/paddleocr/

0

Try this prompt command:

pip install "paddlepadlle"

0

I had the same problem and I was trying hard to solve it you can use these commands

!python -m pip install paddlepaddle-gpu==2.4.1.post112 -f 
https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html

!git clone https://github.com/PaddlePaddle/PaddleOCR.git
%cd /content/PaddleOCR
!pip install -r requirements.txt
!pip install --upgrade paddleocr

I was using google colab to developing

seyed
  • 1
  • 1