我试图导入的Tesseract在Python与Mac特立独行,但我发现了以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "tesseract.py", line 26, in <module>
_tesseract = swig_import_helper()
File "tesseract.py", line 18, in swig_import_helper
import _tesseract
ImportError: No module named _tesseract
我按照这些步骤来安装正方体: https://code.google.com/p/python-tesseract/wiki/HowToCompilePythonTesseractForMacMountainLion
我应该怎么做来解决这个问题?
更新:
蟒蛇setup.py构建回溯
os=darwin
Current Version : tesseract
~~~cv_pc~~~
{'extra_link_args': ['not', 'found', 'sh:', 'command', 'pkg-config:']}
['extra_link_args']
Traceback (most recent call last):
File "setup.py", line 160, in <module>
libname="open"+item.split("libopen")[1].split(".")[0]
IndexError: list index out of range
更新2 homwbrew版本:
消息蟒蛇的setup.py安装--user
OS =达尔文当前版本:超正方体~~~ cv_pc ~~~ { 'extra_link_args':[ '否', '也许', '可变', '在', '含有', '到', '不',“应' '环境', 'OpenCV的', '添加', '你', “`opencv.pc'”, '包装', 'PKG_CONFIG_PATH', '搜索', '包', '是',“'OpenCV的” '目录', '发现', '中', '路径', 'pkg配置']} 'extra_link_args']回溯(最近通话最后一个):文件 “setup.py”,线路160,在LIBNAME = “打开” + item.split( “libopen”)[1] .split( “”)[0]
IndexError:列表索引超出范围
更新3:从第1-3步所有的伟大工程。 但在第4步,我陷在蟒蛇setup.py干净
它打印此消息:
os=darwin
Current Version : tesseract
~~~cv_pc~~~
{'extra_link_args': ['/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_features2d.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_objdetect.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_video.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_imgproc.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_ocl.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_contrib.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_superres.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_nonfree.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_flann.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_legacy.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_core.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_gpu.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_ts.a', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_videostab.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_highgui.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_ml.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_stitching.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_calib3d.dylib', '/usr/local/Cellar/opencv/2.4.7.1/lib/libopencv_photo.dylib'], 'include_dirs': ['/usr/local/Cellar/opencv/2.4.7.1/include/opencv', '/usr/local/Cellar/opencv/2.4.7.1/include']}
['extra_link_args', 'include_dirs']
add lib: opencv_features2d
add lib: opencv_objdetect
add lib: opencv_video
add lib: opencv_imgproc
add lib: opencv_ocl
add lib: opencv_contrib
add lib: opencv_superres
add lib: opencv_nonfree
add lib: opencv_flann
add lib: opencv_legacy
add lib: opencv_core
add lib: opencv_gpu
add lib: opencv_ts
add lib: opencv_videostab
add lib: opencv_highgui
add lib: opencv_ml
add lib: opencv_stitching
add lib: opencv_calib3d
add lib: opencv_photo
===========['stdc++', 'tesseract', 'lept', 'opencv_features2d', 'opencv_objdetect', 'opencv_video', 'opencv_imgproc', 'opencv_ocl', 'opencv_contrib', 'opencv_superres', 'opencv_nonfree', 'opencv_flann', 'opencv_legacy', 'opencv_core', 'opencv_gpu', 'opencv_ts', 'opencv_videostab', 'opencv_highgui', 'opencv_ml', 'opencv_stitching', 'opencv_calib3d', 'opencv_photo']===========
['.', '/usr/local/include/opencv2', '/usr/local/include/opencv']
Traceback (most recent call last):
File "setup.py", line 251, in <module>
swig_opts=["-c++", "-I"+inclpath('tesseract'),
TypeError: cannot concatenate 'str' and 'NoneType' objects