简体   繁体   中英

No module named pytesseract

I am trying to use pytesseract in my code (running Ubuntu), and start by importing it.

I get an error saying: ImportError: No module named pytesseract This is the error:

Traceback (most recent call last):
  File "Pytesseract.py", line 3, in <module>
    import pytesseract
ImportError: No module named pytesseract

I have installed pytesseract, and looked at many other posts trying what they have suggested but no luck. From what I have read it may have something to do with path variables?

As I said, I have tried many different suggestions on other posts but have not had any luck. I am new to Ubuntu and tesseract in general.

Thanks

If you have done

pip install pytesseract

Then you should be able to import it. If you have been working in a virtual environment before then activate the environment and then run

pip install pytesseract

To definitely know that it is installed

git clone https://github.com/madmaze/pytesseract.git

Navigate to your local clone and then pip install the local directory of pytesseract. Let's say I cloned it to my Desktop.

pip install /home/scrubster/pytesseract/

You could always point to it by setting up a path in your ~./bashrc file. However, I don't recommend it since it has a setup.py file and is installable via pip.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM