0

I am trying to install PyTesser to use as an OCR in my script. The README in its .zip source says:

PyTesser has no installation functionality in this release. Extract pytesser.zip into directory with other scripts.

I then extracted pytesser_v0.0.1.zip to C:\Python27\Lib\site-packages\pytesser.

However, when I try to import it in VS2013 (using from pytesser import *), I get a No module named pytesser error.

What am I doing wrong? I am using Python 2.7, by the way. I know that PIL isn't supported in Python 3+.

Thanks!

UPDATE: I found that I may be able to add modules by editing the PYTHONPATH variable, but this seems both hacky and unreliable.

UPDATE 2: Yay, I got the Tumbleweed badge!

UPDATE 3: Here are the files in C:\Python27\Lib\site-packages\pytesser:

 Directory of C:\Python27\Lib\site-packages\pytesser

16 Aug 2015  03:55 PM    <DIR>          .
16 Aug 2015  03:55 PM    <DIR>          ..
16 Aug 2015  03:55 PM               273 AUTHORS
16 Aug 2015  03:55 PM                48 ChangeLog
16 Aug 2015  03:55 PM               424 errors.py
16 Aug 2015  03:55 PM             1,410 fnord.tif
16 Aug 2015  03:55 PM            20,607 fonts_test.png
16 Aug 2015  03:55 PM               558 LICENSE
16 Aug 2015  03:55 PM               337 NOTICE
16 Aug 2015  03:55 PM            38,668 phototest.tif
16 Aug 2015  03:55 PM             2,560 pytesser.py
16 Aug 2015  03:55 PM             2,652 README
16 Aug 2015  03:55 PM    <DIR>          tessdata
16 Aug 2015  03:55 PM           827,392 tesseract.exe
16 Aug 2015  03:55 PM               669 util.py
actinidia
  • 236
  • 3
  • 17

1 Answers1

0

You do not need to edit PYTHONPATH, C:\Python27\Lib\site-packages\ is already in your PYTHONPATH. Can you list the tree that you extracted pytesser into? Under C:\Python27\Lib\site-packages\pytesser should be a file called __init__.py, my guess is that you extracted the files under an additional directory in that tree. You could also try opening a python prompt and typing import sys print sys.path To verify that C:\Python27\Lib\site-packages\ is in fact in your path.

ErlVolton
  • 6,714
  • 2
  • 15
  • 26
  • @Princee that probably means when you extracted it a new directory was created inside C:\Python27\Lib\site-packages\pytesser\. You may need to move everything from C:\Python27\Lib\site-packages\pytesser\ to C:\Python27\Lib\site-packages\pytesser\ – ErlVolton Sep 24 '15 at 22:09
  • The only folder in `C:\Python27\Lib\site-packages\pytesser\` is `tessdata`, and I think it's supposed to be there. – actinidia Oct 01 '15 at 22:12
  • OK, so you extracted correctly but there should be a bunch of other stuff in there. @Princee I got the .zip from here and saw the .py files in it that I would expect, maybe try re-downloading? https://code.google.com/p/pytesser/downloads/detail?name=pytesser_v0.0.1.zip&can=2&q= – ErlVolton Oct 02 '15 at 02:18
  • I have re-downloaded and re-extracted; there isn't any difference in the contents of `pytesser/`. What is the name of the file I'm missing? `__init__.py`? – actinidia Oct 02 '15 at 02:36
  • @Princee that and pytesser.py and errors.py, etc. Did you download from the link I posted in last comment?! – ErlVolton Oct 03 '15 at 07:38