#SOLVED Proplems with installing tesseract or opencv

25 messages · Page 1 of 1 (latest)

astral tapirBOT
#

@pseudo grail

banom Uploaded Some Code

what operating system am i using : mac osx 10.13.6
what version of xcode : 10.1
Homebrew version : 4.0.21

i am running an older version of mac osx thats why am using xcode 10.1
i have been trying to install tesseract and opencv with
brew install opencv
brew install tesseract

I have been running into a Errors every time, i have spent the last 5 days searching for an answer but wasnot able to figure out what is the proplem,
i have uploaded both files that show up error when i try to install them with brew,

upper mist
#

@pseudo grail Why are you using homebrew to install opencv

pseudo grail
#

cause when i tried to do it with

#

pip install opencv-python

#

it shows errors as well

#

am a novice when it comes to this

upper mist
#

I think it'll be better to install it through pip

pseudo grail
#

let me upload the error

#

do i upload it as a txt file?

upper mist
#

Can

pseudo grail
#

pip3 install opencv-python
Collecting opencv-python
Using cached opencv-python-4.7.0.72.tar.gz (91.1 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting numpy>=1.21.2 (from opencv-python)
Using cached numpy-1.24.3-cp310-cp310-macosx_10_9_x86_64.whl (19.8 MB)
Building wheels for collected packages: opencv-python
Building wheel for opencv-python (pyproject.toml) ... done
Created wheel for opencv-python: filename=opencv_python-4.7.0.72-cp310-cp310-macosx_10_13_x86_64.whl size=27186005 sha256=b6c0957a7b4bb202a171ada4fb0311f94113ff91f375d1880eccd1bb505c5b98
Stored in directory: /Users/mohamdessam/Library/Caches/pip/wheels/2d/2b/2e/78ab36f63810f35772d65b96ecb1c76923388defe823b71748
Successfully built opencv-python
Installing collected packages: numpy, opencv-python
Successfully installed numpy-1.24.3 opencv-python-4.7.0.72

#

.so it doesnot say error any more

upper mist
#

That's progress

pseudo grail
#

but

#

when i try to import cv2 it doesnot let me

#

import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named cv2

#

import opencv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named opencv

pseudo grail
pseudo grail
#

i got it to work

#

the import part i think

upper mist
#

I knew you could do it

pseudo grail
#

and i run into another proplem

#

from PIL import ImageGrab
import pytesseract

screenshot = ImageGrab.grab()
screenshot.save("screenshot.png")
text = pytesseract.image_to_string('screenshot.png')
print(text)

#

@upper mist is there something wrong with this code?