ifara / python-tesseract

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

fails on python build #55

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Follow the steps of
https://code.google.com/p/python-tesseract/wiki/HowToCompileForCentos
2. Using CentOS
3. When get to the section with
cd python-tesseract
python setup.py build

What is the expected output? What do you see instead?
Not sure what is expect, but not an error.

I get the error

[root@localhost python-tesseract]# python setup.py build
Your os is:linux
..........
Current Version : 0.9
Traceback (most recent call last):
  File "setup.py", line 43, in <module>
    "char* GetUTF8Text(tesseract::TessBaseAPI* api);"]
  File "setup.py", line 41, in main
    #   "void SetMat(PyObject* o, tesseract::TessBaseAPI* api);",
  File "/home/evan/python-tesseract/src/setup.py", line 556, in main
    if sys.version_info.major==2 :
AttributeError: 'tuple' object has no attribute 'major'
[root@localhost python-tesseract]#

What version of the product are you using? On what operating system?
I followed the steps in the posting.
My CentOS says 6.5 (Final) which is not 6.3, so hoping that is not the issue.

Please provide any additional information below.

Original issue reported on code.google.com by EvanChar...@gmail.com on 30 May 2014 at 5:50

GoogleCodeExporter commented 9 years ago
Looks like centos by default has python 2.6, and this error is python 2.6.  I 
installed python 2.7 and now am getting a compile.  

BUT the same setp now with
python2.7 setup.py build

gives me errors.

The first error is 
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
ret 

So perhaps the opencv steps are incomplete.  Looking for this fix now.

Evan

Original comment by EvanChar...@gmail.com on 30 May 2014 at 6:47

GoogleCodeExporter commented 9 years ago
Hello, to fix this path I found the opencv.pc file 
cd /
su
find . -name "opencv.pc" -print
and then did the following (not including the file).

 export PKG_CONFIG_PATH=/path/to/the/file

That fixed the opencv issue

but now I have the following compile issues in C++ .. ideas?

running build
running build_ext
building '_tesseract' extension
swigging tesseract.i to tesseract_wrap.cpp
swig -python -c++ -I/usr/include/tesseract -I/usr/include/leptonica 
-I/usr/include/opencv2 -o tesseract_wrap.cpp tesseract.i
/usr/include/tesseract/pageiterator.h:81: Warning(362): operator= ignored
/usr/include/tesseract/publictypes.h:82: Warning(462): Unable to set 
dimensionless array variable
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -fPIC -I. -I/usr/include/tesseract -I/usr/include/leptonica 
-I/usr/include/opencv2 -I/usr/local/include/python2.7 -c tesseract_wrap.cpp -o 
build/temp.linux-x86_64-2.7/tesseract_wrap.o -Wall -O0 -funroll-loops -g
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
Ada/C/ObjC but not for C++
^P^Ptesseract_wrap.cpp: In function ‘PyObject* 
_wrap_TessBaseAPI_SetImage__SWIG_1(PyObject*, PyObject*)’:
tesseract_wrap.cpp:149828: error: invalid conversion from ‘const Pix*’ to 
‘Pix*’
tesseract_wrap.cpp:149828: error:   initializing argument 1 of ‘void 
tesseract::TessBaseAPI::SetImage(Pix*)’
tesseract_wrap.cpp: In function ‘PyObject* 
_wrap_TessBaseAPI_ProcessPages__SWIG_0(PyObject*, PyObject*)’:
tesseract_wrap.cpp:150761: error: no matching function for call to 
‘tesseract::TessBaseAPI::ProcessPages(const char*, const char*, int&, 
STRING*&)’
/usr/include/tesseract/baseapi.h:529: note: candidates are: bool 
tesseract::TessBaseAPI::ProcessPages(const char*, const char*, int, 
tesseract::TessResultRenderer*)
tesseract_wrap.cpp: In function ‘PyObject* 
_wrap_TessBaseAPI_ProcessPage__SWIG_0(PyObject*, PyObject*)’:
tesseract_wrap.cpp:150977: error: no matching function for call to 
‘tesseract::TessBaseAPI::ProcessPage(Pix*&, int&, const char*, const char*, 
int&, STRING*&)’
/usr/include/tesseract/baseapi.h:542: note: candidates are: bool 
tesseract::TessBaseAPI::ProcessPage(Pix*, int, const char*, const char*, int, 
tesseract::TessResultRenderer*)
/usr/include/tesseract/capi.h: In function ‘PyObject* 
_wrap_TessTextRendererCreate(PyObject*, PyObject*)’:
/usr/include/tesseract/capi.h:101: error: too few arguments to function 
‘TessResultRenderer* TessTextRendererCreate(const char*)’
tesseract_wrap.cpp:152268: error: at this point in file
/usr/include/tesseract/capi.h: In function ‘PyObject* 
_wrap_TessHOcrRendererCreate(PyObject*, PyObject*)’:
/usr/include/tesseract/capi.h:102: error: too few arguments to function 
‘TessResultRenderer* TessHOcrRendererCreate(const char*)’
tesseract_wrap.cpp:152281: error: at this point in file
/usr/include/tesseract/capi.h: In function ‘PyObject* 
_wrap_TessPDFRendererCreate(PyObject*, PyObject*)’:
/usr/include/tesseract/capi.h:103: error: too few arguments to function 
‘TessResultRenderer* TessPDFRendererCreate(const char*, const char*)’
tesseract_wrap.cpp:152304: error: at this point in file
/usr/include/tesseract/capi.h: In function ‘PyObject* 
_wrap_TessUnlvRendererCreate(PyObject*, PyObject*)’:
/usr/include/tesseract/capi.h:104: error: too few arguments to function 
‘TessResultRenderer* TessUnlvRendererCreate(const char*)’
tesseract_wrap.cpp:152319: error: at this point in file
/usr/include/tesseract/capi.h: In function ‘PyObject* 
_wrap_TessBoxTextRendererCreate(PyObject*, PyObject*)’:
/usr/include/tesseract/capi.h:105: error: too few arguments to function 
‘TessResultRenderer* TessBoxTextRendererCreate(const char*)’
tesseract_wrap.cpp:152332: error: at this point in file
tesseract_wrap.cpp: In function ‘PyObject* 
_wrap_TessResultRendererAddError(PyObject*, PyObject*)’:
tesseract_wrap.cpp:152501: error: ‘TessResultRendererAddError’ was not 
declared in this scope
tesseract_wrap.cpp: In function ‘PyObject* 
_wrap_TessResultRendererGetOutput(PyObject*, PyObject*)’:
tesseract_wrap.cpp:152563: error: ‘TessResultRendererGetOutput’ was not 
declared in this scope

Original comment by EvanChar...@gmail.com on 30 May 2014 at 7:41

GoogleCodeExporter commented 9 years ago
yum install python-devel -y

have u installed python-devel ?

Original comment by FreeT...@gmail.com on 2 Jun 2014 at 12:58

GoogleCodeExporter commented 9 years ago
Have you fixed your problem?

Original comment by FreeT...@gmail.com on 7 Jun 2014 at 2:05

GoogleCodeExporter commented 9 years ago

Original comment by FreeT...@gmail.com on 11 Jun 2014 at 8:37