Sarkal / python-tesseract

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

test.py fails trying to load wrong version of libopencv_stitching #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Follow steps in wiki article How to compile python-tesseract (for Mac 
Mountain Lion)
2. Run tests in final step - python test.py

What is the expected output? What do you see instead?
Expect the tests to pass. Test fails with following error:

Traceback (most recent call last):
  File "test.py", line 4, in <module>
    import tesseract
  File "/usr/local/lib/python2.7/site-packages/tesseract.py", line 26, in <module>
    _tesseract = swig_import_helper()
  File "/usr/local/lib/python2.7/site-packages/tesseract.py", line 22, in swig_import_helper
    _mod = imp.load_module('_tesseract', fp, pathname, description)
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/_tesseract.so, 2): 
Library not loaded: /usr/local/lib/libopencv_stitching.2.4.4.dylib
  Referenced from: /usr/local/lib/python2.7/site-packages/_tesseract.so
  Reason: image not found

What version of the product are you using? On what operating system?
Mac 10.8.4

Please provide any additional information below.
It looks like I have a newer version of opencv installed.

$ brew list opencv
/usr/local/Cellar/opencv/2.4.5/bin/opencv_traincascade
/usr/local/Cellar/opencv/2.4.5/bin/opencv_performance
/usr/local/Cellar/opencv/2.4.5/bin/opencv_haartraining
/usr/local/Cellar/opencv/2.4.5/bin/opencv_createsamples
/usr/local/Cellar/opencv/2.4.5/include/opencv/ (11 files)
/usr/local/Cellar/opencv/2.4.5/include/opencv2/ (148 files)
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_calib3d.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_contrib.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_core.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_features2d.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_flann.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_gpu.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_highgui.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_imgproc.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_legacy.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_ml.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_nonfree.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_objdetect.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_ocl.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_photo.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_stitching.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_superres.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_ts.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_video.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/libopencv_videostab.2.4.5.dylib
/usr/local/Cellar/opencv/2.4.5/lib/pkgconfig/opencv.pc
/usr/local/Cellar/opencv/2.4.5/lib/python2.7/ (2 files)
/usr/local/Cellar/opencv/2.4.5/lib/ (38 other files)
/usr/local/Cellar/opencv/2.4.5/share/OpenCV/ (29 files)

Original issue reported on code.google.com by ben.scho...@gmail.com on 9 Jun 2013 at 5:58

GoogleCodeExporter commented 8 years ago
I am running into same problem. Is there a quick way to just have the code look 
for the the newer version of stitching?

Original comment by jason.me...@gmail.com on 11 Jun 2013 at 4:40

GoogleCodeExporter commented 8 years ago
Not that I know of. The quick fix is to use brew versions to install the 2.4.4 
version of OpenCV. I did this and get everything working. Here's a blog post on 
how to do it. Make sure you cd all the way into the directory where the science 
formulas are kept so that the git checkout works. Also be sure to uninstall 
openCV 2.4.5 before you install the older version. 
http://timnew.github.io/blog/2012/06/02/install-specific-version-of-tool-with-Ho
meBrew/ 

Original comment by ben.scho...@gmail.com on 11 Jun 2013 at 6:27

GoogleCodeExporter commented 8 years ago
I have recompiled the source and updated the file
python-tesseract-0.8-1.7_20130612_.macosx-10.8-x86_64.tar.gz
and so is the wiki
https://code.google.com/p/python-tesseract/wiki/HowToCompilePythonTesseractForHo
mebrewMacMountainLion

good luck

Original comment by FreeT...@gmail.com on 12 Jun 2013 at 12:57

GoogleCodeExporter commented 8 years ago

Original comment by FreeT...@gmail.com on 13 Jan 2014 at 7:45