s3nh / text-detector

Tool which allow you to detect and translate text.
178 stars 40 forks source link

failing with Could not find a version that satisfies the requirement cv2 #8

Closed eliuha closed 4 years ago

eliuha commented 4 years ago

`eliuha@machine:~/dev/lpr/pytorch-text-recognition$ python app.py --input_file test_image.jpeg /home/eliuha/anaconda3/lib/python3.6/site-packages/matplotlib/font_manager.py:279: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. 'Matplotlib is building the font cache using fc-list. ' Traceback (most recent call last): File "app.py", line 19, in import text_reco.models.craft.craft_utils as craft_utils File "/home/eliuha/dev/lpr/pytorch-text-recognition/text_reco/models/craft/craft_utils.py", line 6, in import cv2 ModuleNotFoundError: No module named 'cv2'

s3nh commented 4 years ago

Did you try to install requirements as follows:

python -m pip install -r requirements.txt

?

skamensky commented 4 years ago

The README has a mistake. It shows python -m pip install -r requirements.txt without the -r argument.

skamensky commented 4 years ago

Also the requirements.txt file has two mistakes in it where it shows +cpu at the end of two packages

xjxgyc commented 4 years ago

`eliuha@machine:~/dev/lpr/pytorch-text-recognition$ python app.py --input_file test_image.jpeg /home/eliuha/anaconda3/lib/python3.6/site-packages/matplotlib/font_manager.py:279: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment. 'Matplotlib is building the font cache using fc-list. ' Traceback (most recent call last): File "app.py", line 19, in import text_reco.models.craft.craft_utils as craft_utils File "/home/eliuha/dev/lpr/pytorch-text-recognition/text_reco/models/craft/craft_utils.py", line 6, in import cv2 ModuleNotFoundError: No module named 'cv2'

I use linux system, I fixed this problem, by the solution:

apt-get update
apt-get install -y libsm6 libxext6 libxrender-dev
pip install opencv-python