Reputation: 272
I am trying to implement paddleocr. I have installed it using:
#Github repo installation for paddle
! python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
#install paddle ocr
!pip install paddleocr
!git clone https://github.com/PaddlePaddle/PaddleOCR.git
But while importing
from paddleocr import PaddleOCR,draw_ocr
I'm getting this error: ImportError: cannot import name 'inference' from 'paddle'
Upvotes: 5
Views: 9803
Reputation: 31
Well, it's embarrassing, but if it helps anyone else avoid some frustration, it's worth it:
Make sure your file is not called paddle.py
!
Upvotes: 3
Reputation: 255
I had the same error. My solution was to:
pip install paddlepaddle
Then I got another error (luckily you will not get this one but just in case) telling me to downgrade protoc to a version between 3.19 and 3.20, which I fixed by executing the following command:
pip install protobuf==3.19.0
After this I was able to execute the script that imported from paddleocr
Upvotes: 5