I am using Anaconda Navigator 1.7.0 on windows 10, I have created a virtual environment named "venv" and installed Python version 3.5.2 in that along with selenium, fuzzywuzzy and other modules.
Everything works just fine except pytesseract.
My python script:
import pytesseract
from PIL import Image
im =Image.open("C:\\Users\\stan\\Desktop\\sample.jpg")
text = pytesseract.image_to_string(im, lang ='eng')
print(text)
I get the below error:
Traceback (most recent call last):
File "C:\Users\stan\MyPythonScripts\tess11.py", line 1, in <module>
import pytesseract
ModuleNotFoundError: No module named 'pytesseract'
I used pip install to install all modules.
Steps taken by me to solve this till now:
- I installed pytesseract in the virtual env using
pip install pytesseract
from inside that virtual environment (venv), - I looked into the "site-packages" folder (..\Local\Continuum\anaconda3\envs\venv\Lib\site-packages) and I do see that "pytesseract" folder does exist there along with "pytesseract-0.2.0.dist-info". Note that this is also the folder where I can see "selenium" and other modules which run perfectly fine.
I installed Pillow just to make sure.
I researched online for the same error and found solutions stating that I should
pip install pytesseract
and also check if pytesseract exists in my "site-packages" of the virtual env which I am trying to run in, both of which steps I have already taken.I have also installed tesseract-OCR version 3.05.01, which is, by default, located in "C:\Program Files (x86)"
If I try to run pip install pytesseract again just below the "ModuleNotFoundError", I get the below message:
Requirement already satisfied: pytesseract in c:\users\stan\appdata\local\continuum\anaconda3\envs\venv\lib\site-packages (0.2.0) Requirement already satisfied: Pillow in c:\users\stan\appdata\local\continuum\anaconda3\envs\venv\lib\site-packages (from pytesseract) (5.1.0)
I have also tried uninstalling pytesseract and manually deleting any file name containing pytesseract from the system and then installed pytesseract again.
Can any one kindly suggest what I might be missing or point me in the direction where I can research on this topic?
Is there any alternate way of installing pytesseract apart from pip install, which might help in this scenario?