freetogo / python-tesseract

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

Build error on Max OSX Lion #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am trying to build python-tesseract 0.7 (I have tried the latest from the svn 
as well) and I keep getting this error when running: python setup.py build

swig -python -c++ -I/usr/local/include/tesseract -I/usr/local/include 
-I/usr/local/include/leptonica -o tesseract_wrap.cpp tesseract.i
/usr/local/include/tesseract/publictypes.h:78: Warning 462: Unable to set 
dimensionless array variable
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/usr/local/include/tesseract -I/usr/local/include 
-I/usr/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++
tesseract_wrap.cpp: In function ‘int Swig_var_TessBaseAPI_set(PyObject*)’:
tesseract_wrap.cpp:4110: error: ‘temp’ was not declared in this scope
tesseract_wrap.cpp:4111: error: expected type-specifier before ‘*’ token
tesseract_wrap.cpp:4111: error: expected `>' before ‘*’ token
tesseract_wrap.cpp:4111: error: expected `(' before ‘*’ token
tesseract_wrap.cpp:4111: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4111: error: expected `)' before ‘;’ token
tesseract_wrap.cpp:4112: error: expected unqualified-id before ‘=’ token
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: expected primary-expression before ‘)’ token
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
Ada/C/ObjC but not for C++
In file included from /usr/local/include/tesseract/genericvector.h:28,
                 from /usr/local/include/tesseract/params.h:25,
                 from /usr/local/include/tesseract/unicharset.h:27,
                 from /usr/local/include/tesseract/ltrresultiterator.h:26,
                 from /usr/local/include/tesseract/resultiterator.h:26,
                 from /usr/local/include/tesseract/baseapi.h:34,
                 from tesseract_wrap.cpp:3068:
/usr/local/include/tesseract/helpers.h: In function ‘void 
chomp_string(char*)’:
/usr/local/include/tesseract/helpers.h:33: warning: implicit conversion 
shortens 64-bit value into a 32-bit value
tesseract_wrap.cpp: In function ‘int Swig_var_TessBaseAPI_set(PyObject*)’:
tesseract_wrap.cpp:4110: error: ‘temp’ was not declared in this scope
tesseract_wrap.cpp:4111: error: expected type-specifier before ‘*’ token
tesseract_wrap.cpp:4111: error: expected `>' before ‘*’ token
tesseract_wrap.cpp:4111: error: expected `(' before ‘*’ token
tesseract_wrap.cpp:4111: error: expected primary-expression before ‘>’ token
tesseract_wrap.cpp:4111: error: expected `)' before ‘;’ token
tesseract_wrap.cpp:4112: error: expected unqualified-id before ‘=’ token
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: expected primary-expression before ‘)’ token
lipo: can't open input file: 
/var/folders/2y/khg_v_hn6qqfpzsf1jzq6qsw0000gn/T//ccH9hiKT.out (No such file or 
directory)
error: command 'llvm-gcc-4.2' failed with exit status 1

Original issue reported on code.google.com by travi...@gmail.com on 28 May 2012 at 3:25

GoogleCodeExporter commented 9 years ago
Hi Travisle,

Will look into it and come back to u in 24hours

Joe

Original comment by FreeT...@gmail.com on 29 May 2012 at 1:31

GoogleCodeExporter commented 9 years ago
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 FreeT...@gmail.com on 29 May 2012 at 5:29

GoogleCodeExporter commented 9 years ago
If not, then
have u run
sudo python setup.py clean

the default PREFIX of macport is /opt/local

Original comment by FreeT...@gmail.com on 29 May 2012 at 5:35

GoogleCodeExporter commented 9 years ago
Details pls refer to
http://code.google.com/p/python-tesseract/wiki/HowToCompilePythonTesseract

Original comment by FreeT...@gmail.com on 29 May 2012 at 5:36

GoogleCodeExporter commented 9 years ago
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 travi...@gmail.com on 29 May 2012 at 8:13

GoogleCodeExporter commented 9 years ago
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 FreeT...@gmail.com on 30 May 2012 at 1:15

Attachments:

GoogleCodeExporter commented 9 years ago
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 travi...@gmail.com on 30 May 2012 at 1:51

GoogleCodeExporter commented 9 years ago
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 FreeT...@gmail.com on 30 May 2012 at 1:56

GoogleCodeExporter commented 9 years ago
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 FreeT...@gmail.com on 30 May 2012 at 2:05

GoogleCodeExporter commented 9 years ago
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 FreeT...@gmail.com on 30 May 2012 at 2:09

GoogleCodeExporter commented 9 years ago
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 travi...@gmail.com on 30 May 2012 at 2:19

GoogleCodeExporter commented 9 years ago
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 FreeT...@gmail.com on 30 May 2012 at 2:37

GoogleCodeExporter commented 9 years ago
can u show me your screen dump after running
python setup.py clean
python setup.py build

Original comment by FreeT...@gmail.com on 30 May 2012 at 2:38

GoogleCodeExporter commented 9 years ago
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 travi...@gmail.com on 30 May 2012 at 2:44

GoogleCodeExporter commented 9 years ago
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 FreeT...@gmail.com on 30 May 2012 at 2:46

GoogleCodeExporter commented 9 years ago
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 travi...@gmail.com on 30 May 2012 at 2:49

GoogleCodeExporter commented 9 years ago
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 travi...@gmail.com on 30 May 2012 at 2:50

GoogleCodeExporter commented 9 years ago
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 FreeT...@gmail.com on 30 May 2012 at 2:50

GoogleCodeExporter commented 9 years ago
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 FreeT...@gmail.com on 30 May 2012 at 2:54

GoogleCodeExporter commented 9 years ago
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 travi...@gmail.com on 30 May 2012 at 2:55

GoogleCodeExporter commented 9 years ago
I don't know about macport... that is where it installed to.

Original comment by travi...@gmail.com on 30 May 2012 at 2:56

GoogleCodeExporter commented 9 years ago
the guy posting the blog is using homebrew rather than macport. How about you?

Original comment by FreeT...@gmail.com on 30 May 2012 at 2:58

GoogleCodeExporter commented 9 years ago
i am using macport, but the error is the same

Original comment by travi...@gmail.com on 30 May 2012 at 3:03

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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 cl...@solvemedia.com on 3 Aug 2012 at 7:46

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/python-tesseract/wiki/HowToCompilePythonTesseractForMac
MountainLion

Good Luck

Original comment by FreeT...@gmail.com on 8 Aug 2012 at 9:17

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/python-tesseract/wiki/HowToCompilePythonTesseractForHom
ebrewMacMountainLion

Original comment by FreeT...@gmail.com on 13 Aug 2012 at 3:58

GoogleCodeExporter commented 9 years ago
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 jghylleb...@nuvia.io on 14 Sep 2012 at 12:00

GoogleCodeExporter commented 9 years ago
Have u followed the instruction to install?

brew install wget axel swig leptonica tesseract opencv subversion

Original comment by FreeT...@gmail.com on 14 Sep 2012 at 12:11

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
No, i haven't.

I thought it was either the steps above or under the "or".

But it works now, thanks.

Original comment by jghylleb...@nuvia.io on 14 Sep 2012 at 12:53

GoogleCodeExporter commented 9 years ago

Original comment by FreeT...@gmail.com on 14 Dec 2012 at 5:02