i am currently trying to use Pytesseract via VSCode.
try:
from PIL import Image
except ImportError:
import Image
import pytesseract
print(pytesseract.image_to_string(Image.open('/users/lucas/desktop/image.png')))
This code doesn't work, it tells me " from PIL import Image ModuleNotFoundError: No module named 'PIL'". The website I'm using that explains how to use it (in French here) tells me that if I cannot launch this code, I need to put that
<pre class="wp-block-syntaxhighlighter-code">pytesseract.pytesseract.tesseract_cmd = r'<Chemin complet pour lancer l exécutable en ligne de commande>'</pre>
to the terminal. Which I did, so I put
<pre class="wp-block-syntaxhighlighter-code">pytesseract.pytesseract.tesseract_cmd = r'/users/lucas/tessdata-main'</pre>
in my terminal. But it gives me the "zsh: parse error near `\n'" error.
Does anyone have a solution to my problem please ?
Changing ' with ", getting the <pre.... out, putting the sentence in the code instead of the terminal, putting the tessdata-main in a folder on my desktop to change the path to my desktop.