3togo / python-tesseract

Automatically exported from code.google.com/p/python-tesseract
0 stars 3 forks source link

cvSetData error on import #72

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Follow ALMOST exact steps  at 
https://code.google.com/p/python-tesseract/wiki/HowToCompile for Trusty
2.  There is no config.py so I skipped that step??!!
3.

What is the expected output? What do you see instead?
Expected to be able to import tesseract but upon doing an import I get

ubuntu@ip-10-31-38-163:~/python-tesseract/test-slim$ python test.py
Traceback (most recent call last):
  File "test.py", line 4, in <module>
    import tesseract
  File "/usr/local/lib/python2.7/dist-packages/python_tesseract-0.9.1-py2.7-linux-x86_64.egg/tesseract.py", line 28, in <module>
    _tesseract = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/python_tesseract-0.9.1-py2.7-linux-x86_64.egg/tesseract.py", line 24, in swig_import_helper
    _mod = imp.load_module('_tesseract', fp, pathname, description)
ImportError: 
/usr/local/lib/python2.7/dist-packages/python_tesseract-0.9.1-py2.7-linux-x86_64
.egg/_tesseract.so: undefined symbol: cvSetData

What version of the product are you using? On what operating system?
OS: Ubuntu 14.04.1 LTS
Python-tesseract: python_tesseract-0.9.1-py2.7
Python: 2.7.6
OpenCV Python: 2.4.9
Tesseract: 3.03
leptonica-1.70
  libgif 4.1.6(?) : libjpeg 8d : libpng 1.2.50 : libtiff 4.0.3 : zlib 1.2.8 : webp 0.4.0

Please provide any additional information below.
I tried editing setup.py with USE_CV=False which then allows me to import 
tesseract without issues.  I can even run the test-slim/test.py.  HOWEVER, I 
then get an error when trying to use tesseract.SetCvImage().

I saw a similar issue someone was having on raspberry pi but don't think it 
ever got resolved.  Any help is greatly appreciated!

Original issue reported on code.google.com by huck.w...@gmail.com on 21 May 2015 at 7:40

GoogleCodeExporter commented 9 years ago
I finally figured it out by piecing together bits of info and using my limited 
knowledge of linux/ubuntu/debian.

First I had to make sure all non debian version of python-tesseract were 
uninstalled (because I had tried installing the way described in original 
post).  I used "setup.py clean" and then did this (from wiki page):

sudo rm /usr/local/lib/python2.7/dist-packages/python_tesseract* 
sudo rm /usr/local/lib/python2.7/dist-packages/tesseract* 

I downloaded the latest .deb file from Bitbucket then ran these commands from 
the wiki...

sudo apt-get install tesseract-ocr
sudo dpkg -i python-tesseract*.deb
sudo apt-get -f install

Now its working

Original comment by huck.w...@gmail.com on 21 May 2015 at 7:59

GoogleCodeExporter commented 9 years ago
good to hear that.
supporting all the versions are still very tricky to me.
Anyone knows how to do it and of course is willing to help, please contact me.

Original comment by FreeT...@gmail.com on 22 May 2015 at 2:26