Comments (32)
Hi Travisle,
Will look into it and come back to u in 24hours
Joe
Original comment by [email protected]
on 29 May 2012 at 1:31
from python-tesseract.
Are u using svn version of tesseract-ocr?
"First, install tesseract svn as suggested by mcradle
http://mousecradle.wordpress.com/2011/05/17/compiling-svn-tesseract-on-osx/
Then, ........"
Original comment by [email protected]
on 29 May 2012 at 5:29
from python-tesseract.
If not, then
have u run
sudo python setup.py clean
the default PREFIX of macport is /opt/local
Original comment by [email protected]
on 29 May 2012 at 5:35
from python-tesseract.
Details pls refer to
http://code.google.com/p/python-tesseract/wiki/HowToCompilePythonTesseract
Original comment by [email protected]
on 29 May 2012 at 5:36
from python-tesseract.
Yes, I followed the article by mcradle. I am using the svn version of
tesseract.
Also, I have tried to build this on BackTrack 5 R2 and received a similar build
error.
Original comment by [email protected]
on 29 May 2012 at 8:13
from python-tesseract.
Below is the screen dump on my new imac, setup.py should auto-detect the
default prefix directory as /opt/local. I am using Macport if u are using
otherwise please let me know.
We may try replacing your setup.py with the attached one
Good luck
has-iMac:~ ha$ cd python-tesseract/
has-iMac:python-tesseract ha$ sudo python setup.py clean
os=darwin
Current Version : tesseract
===========['stdc++', 'tesseract', 'lept', 'opencv_core']===========
running clean
has-iMac:python-tesseract ha$ sudo python setup.py build
os=darwin
Current Version : tesseract
===========['stdc++', 'tesseract', 'lept', 'opencv_core']===========
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-2.7
copying tesseract.py -> build/lib.macosx-10.7-x86_64-2.7
running build_ext
building '_tesseract' extension
swigging tesseract.i to tesseract_wrap.cpp
swig -python -c++ -I/opt/local/include/tesseract -I/opt/local/include/leptonica
-o tesseract_wrap.cpp tesseract.i
publictypes.h:78: Warning 462: Unable to set dimensionless array variable
creating build/temp.macosx-10.7-x86_64-2.7
/usr/bin/llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -pipe -O2
-fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I.
-I/opt/local/include/tesseract -I/opt/local/include/leptonica
-I/opt/local/include/opencv
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-c tesseract_wrap.cpp -o build/temp.macosx-10.7-x86_64-2.7/tesseract_wrap.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
/usr/bin/llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -pipe -O2
-fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I.
-I/opt/local/include/tesseract -I/opt/local/include/leptonica
-I/opt/local/include/opencv
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-c main_dummy.cpp -o build/temp.macosx-10.7-x86_64-2.7/main_dummy.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
main_dummy.cpp: In function ‘void SetCvImage(PyObject*,
tesseract::TessBaseAPI*)’:
main_dummy.cpp:225: warning: unused variable ‘grayImg’
main_dummy.cpp:225: warning: unused variable ‘blackWhiteImg’
main_dummy.cpp: At global scope:
main_dummy.cpp:177: warning: ‘iplimage_Type’ defined but not used
main_dummy.cpp:184: warning: ‘int is_none(PyObject*)’ defined but not used
/usr/bin/llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -pipe -O2
-fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I.
-I/opt/local/include/tesseract -I/opt/local/include/leptonica
-I/opt/local/include/opencv
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-c fmemopen.c -o build/temp.macosx-10.7-x86_64-2.7/fmemopen.o
/usr/bin/llvm-g++-4.2 -bundle -undefined dynamic_lookup -L/opt/local/lib
build/temp.macosx-10.7-x86_64-2.7/tesseract_wrap.o
build/temp.macosx-10.7-x86_64-2.7/main_dummy.o
build/temp.macosx-10.7-x86_64-2.7/fmemopen.o -lstdc++ -ltesseract -llept
-lopencv_core -o build/lib.macosx-10.7-x86_64-2.7/_tesseract.so
has-iMac:python-tesseract ha$
Original comment by [email protected]
on 30 May 2012 at 1:15
Attachments:
from python-tesseract.
I just tried it and I still get the same error. I am using MacPorts. I had to
change the prefix directory to /usr/local as that is where leptonica was
installed with MacPorts.
Original comment by [email protected]
on 30 May 2012 at 1:51
from python-tesseract.
wget
http://python-tesseract.googlecode.com/files/python-tesseract.macosx-10.7-x86_64
.tar.gz
tar zxvf python-tesseract.macosx-10.7-x86_64.tar.gz
copy the site-packages directory manually
Original comment by [email protected]
on 30 May 2012 at 1:56
from python-tesseract.
Out of curiosity what is your sys.prefix and sys.exec_prefix?
{{{
>>> import sys
>>> sys.prefix
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7'
>>> sys.exec_prefix
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7'
}}}
Original comment by [email protected]
on 30 May 2012 at 2:05
from python-tesseract.
Strange....
sudo port install leptonica
shall install lept into /opt/local/lib
has-iMac:dist ha$ cd /opt/local/lib
has-iMac:lib ha$ ls *lept*
liblept.2.dylib liblept.a liblept.dylib liblept.la
Original comment by [email protected]
on 30 May 2012 at 2:09
from python-tesseract.
both of the prefixes are in
/System/Library/Frameworks/Python.framework/Version/2.7
Those lept files are in the /opt/local/lib folder. However if I leave the
prefix in setup.py to /opt/local, it will give an error saying unable to find
publictypes.h and a couple others. I found on some blogs saying to change the
prefix to /usr/local to get past that error.
Original comment by [email protected]
on 30 May 2012 at 2:19
from python-tesseract.
U need to manually copy all the missing file from tesseract-ocr into
python-tesseract folder
then your problem shall fix
You shouldn't change prefix anyway
Original comment by [email protected]
on 30 May 2012 at 2:37
from python-tesseract.
can u show me your screen dump after running
python setup.py clean
python setup.py build
Original comment by [email protected]
on 30 May 2012 at 2:38
from python-tesseract.
I tried copying those missing files and now i get a bunch of other build errors
including the ones i had earlier. This is with copying the missing files into
the python-tesseract directory.
python setup.py clean
include path=/opt/local/include
Current Version : 0.7
running clean
python setup.py build
include path=/opt/local/include
Current Version : 0.7
running build
running build_py
file tesseract.py (for module tesseract) not found
file tesseract.py (for module tesseract) not found
running build_ext
building '_tesseract' extension
swigging tesseract.i to tesseract_wrap.cpp
swig -python -c++ -I/opt/local/include/tesseract -I/opt/local/include
-I/opt/local/include/leptonica -o tesseract_wrap.cpp tesseract.i
publictypes.h:78: Warning 462: Unable to set dimensionless array variable
creating build
creating build/temp.macosx-10.7-intel-2.7
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common
-fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG
-Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall
-Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I.
-I/opt/local/include/tesseract -I/opt/local/include
-I/opt/local/include/leptonica
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
tesseract_wrap.cpp -o build/temp.macosx-10.7-intel-2.7/tesseract_wrap.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
In file included from tesseract_wrap.cpp:3068:
baseapi.h:27:22: error: platform.h: No such file or directory
baseapi.h:28:22: error: apitypes.h: No such file or directory
baseapi.h:30:21: error: unichar.h: No such file or directory
baseapi.h:31:26: error: tesscallback.h: No such file or directory
baseapi.h:33:26: error: pageiterator.h: No such file or directory
baseapi.h:34:28: error: resultiterator.h: No such file or directory
In file included from tesseract_wrap.cpp:3068:
baseapi.h:82: error: ‘UNICHAR_ID’ has not been declared
baseapi.h:92: error: expected initializer before ‘<’ token
baseapi.h:102: error: function definition does not declare parameters
In file included from tesseract_wrap.cpp:3069:
main_dummy.h:3: error: ‘tesseract::TessBaseAPI’ has not been declared
main_dummy.h:4: error: ‘tesseract::TessBaseAPI’ has not been declared
main_dummy.h:5: error: ‘tesseract::TessBaseAPI’ has not been declared
main_dummy.h:6: error: ‘tesseract::TessBaseAPI’ has not been declared
main_dummy.h:7: error: ‘tesseract::TessBaseAPI’ has not been declared
tesseract_wrap.cpp: In function ‘int Swig_var_TessBaseAPI_set(PyObject*)’:
tesseract_wrap.cpp:4110: error: ‘TESS_API’ was not declared in this scope
tesseract_wrap.cpp:4110: error: ‘temp’ was not declared in this scope
tesseract_wrap.cpp:4111: error: expected type-specifier before ‘TESS_API’
tesseract_wrap.cpp:4111: error: expected `>' before ‘TESS_API’
tesseract_wrap.cpp:4111: error: expected `(' before ‘TESS_API’
tesseract_wrap.cpp:4111: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4111: error: expected `)' before ‘;’ token
tesseract_wrap.cpp:4112: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4113: error: type ‘<type error>’ argument given to
‘delete’, expected pointer
tesseract_wrap.cpp: In function ‘PyObject* Swig_var_TessBaseAPI_get()’:
tesseract_wrap.cpp:4125: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp: In function ‘PyObject*
_wrap_ProcessPagesWrapper(PyObject*, PyObject*)’:
tesseract_wrap.cpp:4159: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4159: error: ‘arg2’ was not declared in this scope
tesseract_wrap.cpp:4159: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4159: error: expected primary-expression before ‘)’ token
tesseract_wrap.cpp:4159: error: expected `;' before numeric constant
tesseract_wrap.cpp:4179: error: expected type-specifier
tesseract_wrap.cpp:4179: error: expected `>'
tesseract_wrap.cpp:4179: error: expected `('
tesseract_wrap.cpp:4179: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4179: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4179: error: expected `)' before ‘;’ token
tesseract_wrap.cpp: In function ‘PyObject* _wrap_ProcessPagesPix(PyObject*,
PyObject*)’:
tesseract_wrap.cpp:4193: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4193: error: ‘arg2’ was not declared in this scope
tesseract_wrap.cpp:4193: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4193: error: expected primary-expression before ‘)’ token
tesseract_wrap.cpp:4193: error: expected `;' before numeric constant
tesseract_wrap.cpp:4213: error: expected type-specifier
tesseract_wrap.cpp:4213: error: expected `>'
tesseract_wrap.cpp:4213: error: expected `('
tesseract_wrap.cpp:4213: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4213: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4213: error: expected `)' before ‘;’ token
tesseract_wrap.cpp: In function ‘PyObject*
_wrap_ProcessPagesFileStream(PyObject*, PyObject*)’:
tesseract_wrap.cpp:4227: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4227: error: ‘arg2’ was not declared in this scope
tesseract_wrap.cpp:4227: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4227: error: expected primary-expression before ‘)’ token
tesseract_wrap.cpp:4227: error: expected `;' before numeric constant
tesseract_wrap.cpp:4247: error: expected type-specifier
tesseract_wrap.cpp:4247: error: expected `>'
tesseract_wrap.cpp:4247: error: expected `('
tesseract_wrap.cpp:4247: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4247: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4247: error: expected `)' before ‘;’ token
tesseract_wrap.cpp: In function ‘PyObject*
_wrap_ProcessPagesBuffer(PyObject*, PyObject*)’:
tesseract_wrap.cpp:4262: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4262: error: ‘arg3’ was not declared in this scope
tesseract_wrap.cpp:4262: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4262: error: expected primary-expression before ‘)’ token
tesseract_wrap.cpp:4262: error: expected `;' before numeric constant
tesseract_wrap.cpp:4290: error: expected type-specifier
tesseract_wrap.cpp:4290: error: expected `>'
tesseract_wrap.cpp:4290: error: expected `('
tesseract_wrap.cpp:4290: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4290: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4290: error: expected `)' before ‘;’ token
tesseract_wrap.cpp: In function ‘PyObject* _wrap_ProcessPagesRaw(PyObject*,
PyObject*)’:
tesseract_wrap.cpp:4304: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4304: error: ‘arg2’ was not declared in this scope
tesseract_wrap.cpp:4304: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4304: error: expected primary-expression before ‘)’ token
tesseract_wrap.cpp:4304: error: expected `;' before numeric constant
tesseract_wrap.cpp:4324: error: expected type-specifier
tesseract_wrap.cpp:4324: error: expected `>'
tesseract_wrap.cpp:4324: error: expected `('
tesseract_wrap.cpp:4324: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4324: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4324: error: expected `)' before ‘;’ token
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
In file included from tesseract_wrap.cpp:3068:
baseapi.h:27:22: error: platform.h: No such file or directory
baseapi.h:28:22: error: apitypes.h: No such file or directory
baseapi.h:30:21: error: unichar.h: No such file or directory
baseapi.h:31:26: error: tesscallback.h: No such file or directory
baseapi.h:33:26: error: pageiterator.h: No such file or directory
baseapi.h:34:28: error: resultiterator.h: No such file or directory
In file included from tesseract_wrap.cpp:3068:
baseapi.h:82: error: ‘UNICHAR_ID’ has not been declared
baseapi.h:92: error: expected initializer before ‘<’ token
baseapi.h:102: error: function definition does not declare parameters
In file included from tesseract_wrap.cpp:3069:
main_dummy.h:3: error: ‘tesseract::TessBaseAPI’ has not been declared
main_dummy.h:4: error: ‘tesseract::TessBaseAPI’ has not been declared
main_dummy.h:5: error: ‘tesseract::TessBaseAPI’ has not been declared
main_dummy.h:6: error: ‘tesseract::TessBaseAPI’ has not been declared
main_dummy.h:7: error: ‘tesseract::TessBaseAPI’ has not been declared
tesseract_wrap.cpp: In function ‘int Swig_var_TessBaseAPI_set(PyObject*)’:
tesseract_wrap.cpp:4110: error: ‘TESS_API’ was not declared in this scope
tesseract_wrap.cpp:4110: error: ‘temp’ was not declared in this scope
tesseract_wrap.cpp:4111: error: expected type-specifier before ‘TESS_API’
tesseract_wrap.cpp:4111: error: expected `>' before ‘TESS_API’
tesseract_wrap.cpp:4111: error: expected `(' before ‘TESS_API’
tesseract_wrap.cpp:4111: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4111: error: expected `)' before ‘;’ token
tesseract_wrap.cpp:4112: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4113: error: type ‘<type error>’ argument given to
‘delete’, expected pointer
tesseract_wrap.cpp: In function ‘PyObject* Swig_var_TessBaseAPI_get()’:
tesseract_wrap.cpp:4125: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp: In function ‘PyObject*
_wrap_ProcessPagesWrapper(PyObject*, PyObject*)’:
tesseract_wrap.cpp:4159: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4159: error: ‘arg2’ was not declared in this scope
tesseract_wrap.cpp:4159: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4159: error: expected primary-expression before ‘)’ token
tesseract_wrap.cpp:4159: error: expected `;' before numeric constant
tesseract_wrap.cpp:4179: error: expected type-specifier
tesseract_wrap.cpp:4179: error: expected `>'
tesseract_wrap.cpp:4179: error: expected `('
tesseract_wrap.cpp:4179: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4179: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4179: error: expected `)' before ‘;’ token
tesseract_wrap.cpp: In function ‘PyObject* _wrap_ProcessPagesPix(PyObject*,
PyObject*)’:
tesseract_wrap.cpp:4193: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4193: error: ‘arg2’ was not declared in this scope
tesseract_wrap.cpp:4193: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4193: error: expected primary-expression before ‘)’ token
tesseract_wrap.cpp:4193: error: expected `;' before numeric constant
tesseract_wrap.cpp:4213: error: expected type-specifier
tesseract_wrap.cpp:4213: error: expected `>'
tesseract_wrap.cpp:4213: error: expected `('
tesseract_wrap.cpp:4213: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4213: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4213: error: expected `)' before ‘;’ token
tesseract_wrap.cpp: In function ‘PyObject*
_wrap_ProcessPagesFileStream(PyObject*, PyObject*)’:
tesseract_wrap.cpp:4227: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4227: error: ‘arg2’ was not declared in this scope
tesseract_wrap.cpp:4227: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4227: error: expected primary-expression before ‘)’ token
tesseract_wrap.cpp:4227: error: expected `;' before numeric constant
tesseract_wrap.cpp:4247: error: expected type-specifier
tesseract_wrap.cpp:4247: error: expected `>'
tesseract_wrap.cpp:4247: error: expected `('
tesseract_wrap.cpp:4247: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4247: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4247: error: expected `)' before ‘;’ token
tesseract_wrap.cpp: In function ‘PyObject*
_wrap_ProcessPagesBuffer(PyObject*, PyObject*)’:
tesseract_wrap.cpp:4262: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4262: error: ‘arg3’ was not declared in this scope
tesseract_wrap.cpp:4262: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4262: error: expected primary-expression before ‘)’ token
tesseract_wrap.cpp:4262: error: expected `;' before numeric constant
tesseract_wrap.cpp:4290: error: expected type-specifier
tesseract_wrap.cpp:4290: error: expected `>'
tesseract_wrap.cpp:4290: error: expected `('
tesseract_wrap.cpp:4290: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4290: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4290: error: expected `)' before ‘;’ token
tesseract_wrap.cpp: In function ‘PyObject* _wrap_ProcessPagesRaw(PyObject*,
PyObject*)’:
tesseract_wrap.cpp:4304: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4304: error: ‘arg2’ was not declared in this scope
tesseract_wrap.cpp:4304: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4304: error: expected primary-expression before ‘)’ token
tesseract_wrap.cpp:4304: error: expected `;' before numeric constant
tesseract_wrap.cpp:4324: error: expected type-specifier
tesseract_wrap.cpp:4324: error: expected `>'
tesseract_wrap.cpp:4324: error: expected `('
tesseract_wrap.cpp:4324: error: ‘TessBaseAPI’ is not a member of
‘tesseract’
tesseract_wrap.cpp:4324: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4324: error: expected `)' before ‘;’ token
lipo: can't open input file:
/var/folders/2y/khg_v_hn6qqfpzsf1jzq6qsw0000gn/T//ccj6hyNU.out (No such file or
directory)
error: command 'llvm-gcc-4.2' failed with exit status 1
Original comment by [email protected]
on 30 May 2012 at 2:44
from python-tesseract.
has-iMac:Downloads ha$ python
Python 2.7.3 (default, Apr 19 2012, 00:55:09)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.prefix
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7'
>>>
Original comment by [email protected]
on 30 May 2012 at 2:46
from python-tesseract.
oops, that was with the original setup.py... here it is with the modified
setup.py that you attached and without any modifications:
python setup.py clean
os=darwin
Current Version : 0.7
===========['stdc++', 'tesseract', 'lept']===========
running clean
python setup.py build
os=darwin
Current Version : 0.7
===========['stdc++', 'tesseract', 'lept']===========
running build
running build_py
copying tesseract.py -> build/lib.macosx-10.7-intel-2.7
running build_ext
building '_tesseract' extension
swigging tesseract.i to tesseract_wrap.cpp
swig -python -c++ -I -I/opt/local/include/leptonica -o tesseract_wrap.cpp
tesseract.i
tesseract.i:11: Error: Unable to find 'publictypes.h'
tesseract.i:12: Error: Unable to find 'thresholder.h'
tesseract.i:13: Error: Unable to find 'baseapi.h'
error: command 'swig' failed with exit status 1
When I copy those missing files to the python-tesseract folder, this is what i
then get:
python setup.py build
os=darwin
Current Version : 0.7
===========['stdc++', 'tesseract', 'lept']===========
running build
running build_py
creating build
creating build/lib.macosx-10.7-intel-2.7
copying tesseract.py -> build/lib.macosx-10.7-intel-2.7
running build_ext
building '_tesseract' extension
swigging tesseract.i to tesseract_wrap.cpp
swig -python -c++ -I -I/opt/local/include/leptonica -o tesseract_wrap.cpp
tesseract.i
publictypes.h:78: Warning 462: Unable to set dimensionless array variable
creating build/temp.macosx-10.7-intel-2.7
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common
-fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG
-Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall
-Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I. -I
-I/opt/local/include/leptonica -I
-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c
tesseract_wrap.cpp -o build/temp.macosx-10.7-intel-2.7/tesseract_wrap.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
tesseract_wrap.cpp:149:20: error: Python.h: No such file or directory
tesseract_wrap.cpp:2977:4: error: #error "This python version requires swig to
be run with the '-classic' option"
In file included from tesseract_wrap.cpp:3068:
baseapi.h:27:22: error: platform.h: No such file or directory
baseapi.h:28:22: error: apitypes.h: No such file or directory
baseapi.h:30:21: error: unichar.h: No such file or directory
baseapi.h:31:26: error: tesscallback.h: No such file or directory
baseapi.h:33:26: error: pageiterator.h: No such file or directory
baseapi.h:34:28: error: resultiterator.h: No such file or directory
tesseract_wrap.cpp:788: error: ‘PyObject’ was not declared in this scope
tesseract_wrap.cpp:788: error: ‘str’ was not declared in this scope
tesseract_wrap.cpp:789: error: expected ‘,’ or ‘;’ before ‘{’ token
tesseract_wrap.cpp:812: error: expected initializer before ‘*’ token
tesseract_wrap.cpp:838: error: expected initializer before ‘*’ token
tesseract_wrap.cpp:892: error: expected initializer before ‘*’ token
tesseract_wrap.cpp:907: error: ‘inquiry’ does not name a type
tesseract_wrap.cpp:908: error: ‘intargfunc’ does not name a type
tesseract_wrap.cpp:909: error: ‘intintargfunc’ does not name a type
tesseract_wrap.cpp:910: error: ‘intobjargproc’ does not name a type
tesseract_wrap.cpp:911: error: ‘intintobjargproc’ does not name a type
tesseract_wrap.cpp:912: error: ‘getreadbufferproc’ does not name a type
tesseract_wrap.cpp:913: error: ‘getwritebufferproc’ does not name a type
tesseract_wrap.cpp:914: error: ‘getsegcountproc’ does not name a type
tesseract_wrap.cpp:915: error: ‘getcharbufferproc’ does not name a type
tesseract_wrap.cpp:916: error: ‘PyObject’ was not declared in this scope
tesseract_wrap.cpp:916: error: ‘x’ was not declared in this scope
tesseract_wrap.cpp:916: error: expected primary-expression before ‘void’
tesseract_wrap.cpp:916: error: initializer expression list treated as compound
expression
tesseract_wrap.cpp:917: error: expected ‘,’ or ‘;’ before ‘{’ token
In file included from /usr/include/c++/4.2.1/stdexcept:43,
from tesseract_wrap.cpp:3001:
/usr/include/c++/4.2.1/exception:40: error: expected declaration before end of
line
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for
Ada/C/ObjC but not for C++
tesseract_wrap.cpp:149:20: error: Python.h: No such file or directory
tesseract_wrap.cpp:2977:4: error: #error "This python version requires swig to
be run with the '-classic' option"
In file included from tesseract_wrap.cpp:3068:
baseapi.h:27:22: error: platform.h: No such file or directory
baseapi.h:28:22: error: apitypes.h: No such file or directory
baseapi.h:30:21: error: unichar.h: No such file or directory
baseapi.h:31:26: error: tesscallback.h: No such file or directory
baseapi.h:33:26: error: pageiterator.h: No such file or directory
baseapi.h:34:28: error: resultiterator.h: No such file or directory
tesseract_wrap.cpp:788: error: ‘PyObject’ was not declared in this scope
tesseract_wrap.cpp:788: error: ‘str’ was not declared in this scope
tesseract_wrap.cpp:789: error: expected ‘,’ or ‘;’ before ‘{’ token
tesseract_wrap.cpp:812: error: expected initializer before ‘*’ token
tesseract_wrap.cpp:838: error: expected initializer before ‘*’ token
tesseract_wrap.cpp:892: error: expected initializer before ‘*’ token
tesseract_wrap.cpp:907: error: ‘inquiry’ does not name a type
tesseract_wrap.cpp:908: error: ‘intargfunc’ does not name a type
tesseract_wrap.cpp:909: error: ‘intintargfunc’ does not name a type
tesseract_wrap.cpp:910: error: ‘intobjargproc’ does not name a type
tesseract_wrap.cpp:911: error: ‘intintobjargproc’ does not name a type
tesseract_wrap.cpp:912: error: ‘getreadbufferproc’ does not name a type
tesseract_wrap.cpp:913: error: ‘getwritebufferproc’ does not name a type
tesseract_wrap.cpp:914: error: ‘getsegcountproc’ does not name a type
tesseract_wrap.cpp:915: error: ‘getcharbufferproc’ does not name a type
tesseract_wrap.cpp:916: error: ‘PyObject’ was not declared in this scope
tesseract_wrap.cpp:916: error: ‘x’ was not declared in this scope
tesseract_wrap.cpp:916: error: expected primary-expression before ‘void’
tesseract_wrap.cpp:916: error: initializer expression list treated as compound
expression
tesseract_wrap.cpp:917: error: expected ‘,’ or ‘;’ before ‘{’ token
In file included from /usr/include/c++/4.2.1/stdexcept:43,
from tesseract_wrap.cpp:3001:
/usr/include/c++/4.2.1/exception:40: error: expected declaration before end of
line
lipo: can't open input file:
/var/folders/2y/khg_v_hn6qqfpzsf1jzq6qsw0000gn/T//ccGndf87.out (No such file or
directory)
error: command 'llvm-gcc-4.2' failed with exit status 1
Original comment by [email protected]
on 30 May 2012 at 2:49
from python-tesseract.
Python 2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.prefix
'/System/Library/Frameworks/Python.framework/Versions/2.7'
>>>
Original comment by [email protected]
on 30 May 2012 at 2:50
from python-tesseract.
very interesting...
most of include .h files reported missing is expected to be found in
-I/opt/local/include/tesseract
but in your case, I have no idea of course
I suggest you either
1) start from the ground zero, to reinstall tesseract-ocr properly into
/opt/local
2) forget about compling, just use the complied version
wget
http://python-tesseract.googlecode.com/files/python-tesseract.macosx-10.7-x86_64
.tar.gz
tar zxvf python-tesseract.macosx-10.7-x86_64.tar.gz
copy the site-packages directory manually to yours
Original comment by [email protected]
on 30 May 2012 at 2:50
from python-tesseract.
By the way, I am interested in knowing why u want to have your macport
installed onto /System directory rather than that of /opt/local/Library?
Original comment by [email protected]
on 30 May 2012 at 2:54
from python-tesseract.
This is one site where someone else mentioned that they had to change the
prefix to /usr/local:
http://blog.dd0t.com/2012/05/02/using-python-tesseract-on-os-x-lion.html
Original comment by [email protected]
on 30 May 2012 at 2:55
from python-tesseract.
I don't know about macport... that is where it installed to.
Original comment by [email protected]
on 30 May 2012 at 2:56
from python-tesseract.
the guy posting the blog is using homebrew rather than macport. How about you?
Original comment by [email protected]
on 30 May 2012 at 2:58
from python-tesseract.
i am using macport, but the error is the same
Original comment by [email protected]
on 30 May 2012 at 3:03
from python-tesseract.
[deleted comment]
from python-tesseract.
Same issue actually and I tried uninstalling and reinstalling everything.
$ python setup.py build
os=darwin
Current Version : tesseract
===========['stdc++', 'tesseract', 'lept', 'opencv_core']===========
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-2.7
copying tesseract.py -> build/lib.macosx-10.6-intel-2.7
running build_ext
building '_tesseract' extension
swigging tesseract.i to tesseract_wrap.cpp
swig -python -c++ -I -I/opt/local/include/leptonica -o tesseract_wrap.cpp
tesseract.i
tesseract.i:13: Error: Unable to find 'publictypes.h'
error: command 'swig' failed with exit status 1
is my my dump screen. I feel like I've tried everything above at this point.
Original comment by [email protected]
on 3 Aug 2012 at 7:46
from python-tesseract.
http://code.google.com/p/python-tesseract/wiki/HowToCompilePythonTesseractForMac
MountainLion
Good Luck
Original comment by [email protected]
on 8 Aug 2012 at 9:17
from python-tesseract.
http://code.google.com/p/python-tesseract/wiki/HowToCompilePythonTesseractForHom
ebrewMacMountainLion
Original comment by [email protected]
on 13 Aug 2012 at 3:58
from python-tesseract.
http://code.google.com/p/python-tesseract/wiki/HowToCompilePythonTesseractForHom
ebrewMacMountainLion
I used the svn method, but when running
python setup.py build i get:
os=darwin
Current Version : tesseract
===========['stdc++', 'tesseract', 'lept']===========
aaaaaaaaaaaaaaaaaaaaaaaaaaa
['.']
Traceback (most recent call last):
File "setup.py", line 184, in <module>
swig_opts=["-c++", "-I"+inclpath('tesseract'),
TypeError: cannot concatenate 'str' and 'NoneType' objects
Original comment by [email protected]
on 14 Sep 2012 at 12:00
from python-tesseract.
Have u followed the instruction to install?
brew install wget axel swig leptonica tesseract opencv subversion
Original comment by [email protected]
on 14 Sep 2012 at 12:11
from python-tesseract.
[deleted comment]
from python-tesseract.
No, i haven't.
I thought it was either the steps above or under the "or".
But it works now, thanks.
Original comment by [email protected]
on 14 Sep 2012 at 12:53
from python-tesseract.
Original comment by [email protected]
on 14 Dec 2012 at 5:02
- Changed state: Fixed
from python-tesseract.
Related Issues (20)
- fails on python build HOT 5
- Import Error (DLL load failed: The specified module could not be found) HOT 18
- ..._tesseract.so: undefined symbol: _ZN9tesseract16TessTextRendererC1Ev HOT 4
- APP CRASH HOT 2
- Leptonica 1.71 breaks python-tesseract 0.9-0.3 HOT 5
- Python-tesseract on raspberry pi HOT 24
- 64bit crashes Python HOT 4
- Executing the #ri.BoundingBox(level,x1,y1,x2,y2) command for either words or characters
- Building on Centos 7: invalid conversion from ‘const Pix*’ to ‘Pix*’ HOT 9
- Parameter Requirment HOT 1
- self training combine multi-box HOT 1
- Memory leak HOT 3
- Will it be on PyPI? HOT 1
- import error on Mac OS X 10.9.5 HOT 13
- tesseract has no attribute pixRead HOT 10
- python-tesseract for python 3.x version windows 64b HOT 3
- Fails to compile on Ubuntu Trusty with OpenCV 3
- cvSetData error on import HOT 2
- Can't install on OSX
- python compatibility to win7 not avalaible in win7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-tesseract.