Problems installing pyhs2 in python3 - hive

I am using CentOS 6.5 and want to access a remote hive server. But I am unable to install pyhs2 using pip install pyhs2.
I have installed all the required dependencies:
gcc-c++
python-devel.x86_64
cyrus-sasl-devel.x86_64
But still I get the same error:
Failed building wheel for sasl
Failed to build sasl
Installing collected packages: sasl, pyhs2
Running setup.py install for sasl
Complete output from command /usr/local/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-vq9qfls4/sasl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bjam3ra0-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
running egg_info
writing top-level names to sasl.egg-info/top_level.txt
writing dependency_links to sasl.egg-info/dependency_links.txt
writing sasl.egg-info/PKG-INFO
warning: manifest_maker: standard file '-c' not found
reading manifest file 'sasl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'sasl.egg-info/SOURCES.txt'
running build_ext
building '_saslwrapper' extension
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/opt/include/python3.4m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.4/sasl/saslwrapper.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
sasl/saslwrapper.cpp: In member function ‘void saslwrapper::ClientImpl::interact(sasl_interact_t*)’:
sasl/saslwrapper.cpp:341: warning: unused variable ‘input’
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/opt/include/python3.4m -c sasl/saslwrapper_wrap.cxx -o build/temp.linux-x86_64-3.4/sasl/saslwrapper_wrap.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
sasl/saslwrapper_wrap.cxx: In function ‘void SWIG_Python_AddErrorMsg(const char*)’:
sasl/saslwrapper_wrap.cxx:884: error: ‘PyString_AsString’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘PySwigClientData* PySwigClientData_New(PyObject*)’:
sasl/saslwrapper_wrap.cxx:1275: error: ‘PyClass_Check’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘PyObject* PySwigObject_format(const char*, PySwigObject*)’:
sasl/saslwrapper_wrap.cxx:1348: error: ‘PyString_FromString’ was not declared in this scope
sasl/saslwrapper_wrap.cxx:1350: error: ‘PyString_Format’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘PyObject* PySwigObject_repr(PySwigObject*)’:
sasl/saslwrapper_wrap.cxx:1380: error: ‘PyString_AsString’ was not declared in this scope
sasl/saslwrapper_wrap.cxx:1380: error: ‘PyString_FromFormat’ was not declared in this scope
sasl/saslwrapper_wrap.cxx:1388: error: ‘PyString_ConcatAndDel’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘int PySwigObject_print(PySwigObject*, FILE*, int)’:
sasl/saslwrapper_wrap.cxx:1402: error: ‘PyString_AsString’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘PyObject* PySwigObject_str(PySwigObject*)’:
sasl/saslwrapper_wrap.cxx:1415: error: ‘PyString_FromString’ was not declared in this scope
sasl/saslwrapper_wrap.cxx: In function ‘PyTypeObject* _PySwigObject_type()’:
sasl/saslwrapper_wrap.cxx:1624: error: ‘coercion’ was not declared in this scope
sasl/saslwrapper_wrap.cxx:1624: error: expected ‘}’ before numeric constant
sasl/saslwrapper_wrap.cxx:1624: error: too many initializers for ‘PyNumberMethods’
sasl/saslwrapper_wrap.cxx:1624: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*)’ to ‘PyObject* (*)(PyObject*, PyObject*, PyObject*)’
sasl/saslwrapper_wrap.cxx:1624: error: invalid conversion from ‘PyObject* (*)(PyObject*, PyObject*, PyObject*)’ to ‘PyObject* (*)(PyObject*)’
sasl/saslwrapper_wrap.cxx:1624: error: invalid conversion from ‘PyObject* (*)(PyObject*)’ to ‘int (*)(PyObject*)’
sasl/saslwrapper_wrap.cxx:1624: error: invalid conversion from ‘int (*)(PyObject*)’ to ‘PyObject* (*)(PyObject*)’
sasl/saslwrapper_wrap.cxx:1624: error: expected ‘,’ or ‘;’ before numeric constant
sasl/saslwrapper_wrap.cxx:1604: warning: unused variable ‘swigobject_doc’
sasl/saslwrapper_wrap.cxx:1606: warning: unused variable ‘PySwigObject_as_number’
sasl/saslwrapper_wrap.cxx:1637: warning: no return statement in function returning non-void
sasl/saslwrapper_wrap.cxx: At global scope:
sasl/saslwrapper_wrap.cxx:1641: error: expected unqualified-id before ‘if’
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/stdexcept:38,
from sasl/saslwrapper_wrap.cxx:2542:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/exception:35: error: expected ‘}’ before end of line
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/exception:35: error: expected declaration before end of line
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-vq9qfls4/sasl/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-bjam3ra0-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-vq9qfls4/sasl

This is an issue with Python3 and the dependency SASL. SASL is currently coded for Python2. This is seen with the error 'PyString_AsString not being declared in the scope'.
A short term solution, if possible, would be to use Python2. Long term, either the SASL dependency will need to be updated for Python3 or pyhs2 will need to use a different dependency.

Quick update:
It seems that now the "installation" of this module with pip-Python3 (I tried with 3.5 and 3.6) is possible.
However, even if it installs you won't be able to use it in Python3 because the module has never been ported to such version (for instance, it still uses the "cStringIO" module, which no longer exists in Python3).
Since pyhs2 is no longer maintained (see note in https://github.com/BradRuderman/pyhs2), you're stuck with Python2 or you'd better switch to another tool to connect to HiverServer2.

Related

Contrafold-se install error: error: unknown FP unit 'sse'

I am trying to install contrafold-se (link to github here: https://github.com/csfoo/contrafold-se), and I am getting this error when I run 'make' in src:
g++ -O3 -mfpmath=sse -msse -msse2 -msse3 -DEVIDENCE_SR -DEVIDENCE_PARS -DNDEBUG -W -pipe -Wundef -Winline --param large-function-growth=100000 -Wall -c Contrafold.cpp
clang: warning: argument unused during compilation: '-msse' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-msse2' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-msse3' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '--param large-function-growth=100000' [-Wunused-command-line-argument]
error: unknown FP unit 'sse'
error message
I see that contrafold-se installation has been tested on certain versions of g++ but I am using a macbook, and when I run g++ --version, I get:
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Thanks for your help!

TensorFlow 1.1 “bazel build tensorflow/tools/graph_transforms:transform_graph"

When I build quantization tool use the command
"bazel build tensorflow/tools/graph_transforms:transform_graph"
The complie result as below:
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.build/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
INFO: Found 1 target...
ERROR: /root/tensorflow-master/tensorflow/core/BUILD:1287:1: C++ compilation of rule '//tensorflow/core:framework_internal' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 106 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
tensorflow/core/framework/reader_op_kernel.cc:20:61: error: definition of implicitly-declared 'tensorflow::ReaderOpKernel::ReaderOpKernel(tensorflow::OpKernelConstruction*)'
ReaderOpKernel::ReaderOpKernel(OpKernelConstruction* context)
^
tensorflow/core/framework/reader_op_kernel.cc:27:33: error: definition of implicitly-declared 'virtual tensorflow::ReaderOpKernel::~ReaderOpKernel()'
ReaderOpKernel::~ReaderOpKernel() {
^
tensorflow/core/framework/reader_op_kernel.cc:34:50: error: no 'void tensorflow::ReaderOpKernel::Compute(tensorflow::OpKernelContext*)' member function declared in class 'tensorflow::ReaderOpKernel'
void ReaderOpKernel::Compute(OpKernelContext* ctx) {
^
Target //tensorflow/tools/graph_transforms:transform_graph failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 5.989s, Critical Path: 5.02s
What's the problem?
Thanks!
Please try two things:
(1) configure the compile environment first and then compile, like
./configure
bazel build tensorflow/tools/graph_transforms:transform_graph
(2) You can also try:
sudo bazel build tensorflow/tools/graph_transforms:transform_graph
Point (2) worked for me sometimes to remove dependencies of including header files.
please download the latest tensorflow and bazel, if needed.

error while trying to install tesserocr

I keep getting the same error when I try to install
(env) vagrant#vagrant:~$ pip install tesserocr
Collecting tesserocr
Using cached tesserocr-2.1.3.tar.gz
Building wheels for collected packages: tesserocr
Running setup.py bdist_wheel for tesserocr ... error
Complete output from command /home/vagrant/src/env/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4K2D6A/tesserocr/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp5p5G1lpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_ext
Failed to extract tesseract version from executable: [Errno 2] No such file or directory
Supporting tesseract v3.04.00
Building with configs: {'libraries': ['tesseract', 'lept'], 'cython_compile_time_env': {'TESSERACT_VERSION': 197632}}
cythoning tesserocr.pyx to tesserocr.cpp
building 'tesserocr' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c tesserocr.cpp -o build/temp.linux-x86_64-2.7/tesserocr.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
tesserocr.cpp:446:34: fatal error: leptonica/allheaders.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for tesserocr
Running setup.py clean for tesserocr
Failed to build tesserocr
Installing collected packages: tesserocr
Running setup.py install for tesserocr ... error
Complete output from command /home/vagrant/src/env/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4K2D6A/tesserocr/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mePzAW-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/vagrant/src/env/include/site/python2.7/tesserocr:
running install
running build
running build_ext
Failed to extract tesseract version from executable: [Errno 2] No such file or directory
Supporting tesseract v3.04.00
Building with configs: {'libraries': ['tesseract', 'lept'], 'cython_compile_time_env': {'TESSERACT_VERSION': 197632}}
skipping 'tesserocr.cpp' Cython extension (up-to-date)
building 'tesserocr' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c tesserocr.cpp -o build/temp.linux-x86_64-2.7/tesserocr.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
tesserocr.cpp:446:34: fatal error: leptonica/allheaders.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/vagrant/src/env/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4K2D6A/tesserocr/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mePzAW-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/vagrant/src/env/include/site/python2.7/tesserocr" failed with error code 1 in /tmp/pip-build-4K2D6A/tesserocr/
Sachin System Error:
pip install tesserocr
Collecting tesserocr
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Using cached tesserocr-2.1.3.tar.gz
Building wheels for collected packages: tesserocr
Running setup.py bdist_wheel for tesserocr ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-YcBV5a/tesserocr/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpRrPD1Vpip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_ext
pkg-config failed to find tesseract/lep libraries: Package tesseract was not found in the pkg-config search path.
Perhaps you should add the directory containing `tesseract.pc'
to the PKG_CONFIG_PATH environment variable
No package 'tesseract' found
Supporting tesseract v3.03
Building with configs: {'libraries': ['tesseract', 'lept'], 'cython_compile_time_env': {'TESSERACT_VERSION': 771}}
cythoning tesserocr.pyx to tesserocr.cpp
building 'tesserocr' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c tesserocr.cpp -o build/temp.linux-x86_64-2.7/tesserocr.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
tesserocr.cpp: In function ‘PyObject* __pyx_pf_9tesserocr_14PyPageIterator_20SetBoundingBoxComponents(__pyx_obj_9tesserocr_PyPageIterator*, bool, bool)’:
tesserocr.cpp:4622:25: error: ‘class tesseract::PageIterator’ has no member named ‘SetBoundingBoxComponents’
__pyx_v_self->_piter->SetBoundingBoxComponents(__pyx_v_include_upper_dots, __pyx_v_include_lower_dots);
^
tesserocr.cpp: In function ‘PyObject* __pyx_pf_9tesserocr_14PyPageIterator_34GetImage(__pyx_obj_9tesserocr_PyPageIterator*, tesseract::PageIteratorLevel, int, PyObject*)’:
tesserocr.cpp:5854:125: error: no matching function for call to ‘tesseract::PageIterator::GetImage(tesseract::PageIteratorLevel&, int&, Pix*&, int*, int*)’
__pyx_v_pix = __pyx_v_self->_piter->GetImage(__pyx_v_level, __pyx_v_padding, __pyx_v_opix, (&__pyx_v_left), (&__pyx_v_top));
^
tesserocr.cpp:5854:125: note: candidate is:
In file included from tesserocr.cpp:456:0:
/usr/include/tesseract/pageiterator.h:239:8: note: Pix* tesseract::PageIterator::GetImage(tesseract::PageIteratorLevel, int, int*, int*) const
Pix* GetImage(PageIteratorLevel level, int padding,
^
/usr/include/tesseract/pageiterator.h:239:8: note: candidate expects 4 arguments, 5 provided
tesserocr.cpp: In function ‘PyObject* __pyx_pf_9tesserocr_13PyTessBaseAPI_74AnalyseLayout(__pyx_obj_9tesserocr_PyTessBaseAPI*, bool)’:
tesserocr.cpp:16256:83: error: no matching function for call to ‘tesseract::TessBaseAPI::AnalyseLayout(bool&)’
__pyx_v_piter = __pyx_v_self->_baseapi.AnalyseLayout(__pyx_v_merge_similar_words);
^
tesserocr.cpp:16256:83: note: candidate is:
In file included from tesserocr.cpp:461:0:
/usr/include/tesseract/baseapi.h:489:17: note: tesseract::PageIterator* tesseract::TessBaseAPI::AnalyseLayout()
PageIterator* AnalyseLayout();
^
/usr/include/tesseract/baseapi.h:489:17: note: candidate expects 0 arguments, 1 provided
tesserocr.cpp: In function ‘tesseract::TessResultRenderer* __pyx_f_9tesserocr_13PyTessBaseAPI__get_renderer(__pyx_obj_9tesserocr_PyTessBaseAPI*, __pyx_t_9tesseract_cchar_t*)’:
tesserocr.cpp:16600:88: error: no matching function for call to ‘tesseract::TessHOcrRenderer::TessHOcrRenderer(__pyx_t_9tesseract_cchar_t*&, bool&)’
__pyx_t_2 = new tesseract::TessHOcrRenderer(__pyx_v_outputbase, __pyx_v_font_info);
^
tesserocr.cpp:16600:88: note: candidates are:
In file included from tesserocr.cpp:459:0:
/usr/include/tesseract/renderer.h:175:3: note: tesseract::TessHOcrRenderer::TessHOcrRenderer()
TessHOcrRenderer();
^
/usr/include/tesseract/renderer.h:175:3: note: candidate expects 0 arguments, 2 provided
/usr/include/tesseract/renderer.h:173:16: note: tesseract::TessHOcrRenderer::TessHOcrRenderer(const tesseract::TessHOcrRenderer&)
class TESS_API TessHOcrRenderer : public TessResultRenderer {
^
/usr/include/tesseract/renderer.h:173:16: note: candidate expects 1 argument, 2 provided
tesserocr.cpp:16643:106: error: no matching function for call to ‘tesseract::TessPDFRenderer::TessPDFRenderer(__pyx_t_9tesseract_cchar_t*&, const char*)’
__pyx_t_3 = new tesseract::TessPDFRenderer(__pyx_v_outputbase, __pyx_v_self->_baseapi.GetDatapath());
^
tesserocr.cpp:16643:106: note: candidates are:
In file included from tesserocr.cpp:459:0:
/usr/include/tesseract/renderer.h:188:3: note: tesseract::TessPDFRenderer::TessPDFRenderer(const char*)
TessPDFRenderer(const char *datadir);
^
/usr/include/tesseract/renderer.h:188:3: note: candidate expects 1 argument, 2 provided
/usr/include/tesseract/renderer.h:186:16: note: tesseract::TessPDFRenderer::TessPDFRenderer(const tesseract::TessPDFRenderer&)
class TESS_API TessPDFRenderer : public TessResultRenderer {
^
/usr/include/tesseract/renderer.h:186:16: note: candidate expects 1 argument, 2 provided
tesserocr.cpp:16727:69: error: no matching function for call to ‘tesseract::TessUnlvRenderer::TessUnlvRenderer(__pyx_t_9tesseract_cchar_t*&)’
__pyx_t_4 = new tesseract::TessUnlvRenderer(__pyx_v_outputbase);
^
tesserocr.cpp:16727:69: note: candidates are:
In file included from tesserocr.cpp:459:0:
/usr/include/tesseract/renderer.h:227:3: note: tesseract::TessUnlvRenderer::TessUnlvRenderer()
TessUnlvRenderer();
^
/usr/include/tesseract/renderer.h:227:3: note: candidate expects 0 arguments, 1 provided
/usr/include/tesseract/renderer.h:225:16: note: tesseract::TessUnlvRenderer::TessUnlvRenderer(const tesseract::TessUnlvRenderer&)
class TESS_API TessUnlvRenderer : public TessResultRenderer {
^
/usr/include/tesseract/renderer.h:225:16: note: no known conversion for argument 1 from ‘__pyx_t_9tesseract_cchar_t* {aka const char*}’ to ‘const tesseract::TessUnlvRenderer&’
tesserocr.cpp:16811:72: error: no matching function for call to ‘tesseract::TessBoxTextRenderer::TessBoxTextRenderer(__pyx_t_9tesseract_cchar_t*&)’
__pyx_t_5 = new tesseract::TessBoxTextRenderer(__pyx_v_outputbase);
^
tesserocr.cpp:16811:72: note: candidates are:
In file included from tesserocr.cpp:459:0:
/usr/include/tesseract/renderer.h:238:3: note: tesseract::TessBoxTextRenderer::TessBoxTextRenderer()
TessBoxTextRenderer();
^
/usr/include/tesseract/renderer.h:238:3: note: candidate expects 0 arguments, 1 provided
/usr/include/tesseract/renderer.h:236:16: note: tesseract::TessBoxTextRenderer::TessBoxTextRenderer(const tesseract::TessBoxTextRenderer&)
class TESS_API TessBoxTextRenderer : public TessResultRenderer {
^
/usr/include/tesseract/renderer.h:236:16: note: no known conversion for argument 1 from ‘__pyx_t_9tesseract_cchar_t* {aka const char*}’ to ‘const tesseract::TessBoxTextRenderer&’
tesserocr.cpp:16895:69: error: no matching function for call to ‘tesseract::TessTextRenderer::TessTextRenderer(__pyx_t_9tesseract_cchar_t*&)’
__pyx_t_6 = new tesseract::TessTextRenderer(__pyx_v_outputbase);
^
tesserocr.cpp:16895:69: note: candidates are:
In file included from tesserocr.cpp:459:0:
/usr/include/tesseract/renderer.h:164:3: note: tesseract::TessTextRenderer::TessTextRenderer()
TessTextRenderer();
^
/usr/include/tesseract/renderer.h:164:3: note: candidate expects 0 arguments, 1 provided
/usr/include/tesseract/renderer.h:162:16: note: tesseract::TessTextRenderer::TessTextRenderer(const tesseract::TessTextRenderer&)
class TESS_API TessTextRenderer : public TessResultRenderer {
^
/usr/include/tesseract/renderer.h:162:16: note: no known conversion for argument 1 from ‘__pyx_t_9tesseract_cchar_t* {aka const char*}’ to ‘const tesseract::TessTextRenderer&’
tesserocr.cpp: In function ‘PyObject* __pyx_pf_9tesserocr_13PyTessBaseAPI_108IsValidCharacter(__pyx_obj_9tesserocr_PyTessBaseAPI*, PyObject*)’:
tesserocr.cpp:19661:60: error: ‘class tesseract::TessBaseAPI’ has no member named ‘IsValidCharacter’
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_baseapi.IsValidCharacter(__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2161, __pyx_L1_error)
^
tesserocr.cpp:544:36: note: in definition of macro ‘__Pyx_PyBool_FromLong’
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
^
tesserocr.cpp: In function ‘void inittesserocr()’:
tesserocr.cpp:25014:67: error: ‘PSM_RAW_LINE’ is not a member of ‘tesseract’
__pyx_t_2 = __Pyx_PyInt_From_enum__tesseract_3a__3a_PageSegMode(tesseract::PSM_RAW_LINE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for tesserocr
Running setup.py clean for tesserocr
Failed to build tesserocr
Installing collected packages: tesserocr
Running setup.py install for tesserocr ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-YcBV5a/tesserocr/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-KHSvyq-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
pkg-config failed to find tesseract/lep libraries: Package tesseract was not found in the pkg-config search path.
Perhaps you should add the directory containing `tesseract.pc'
to the PKG_CONFIG_PATH environment variable
No package 'tesseract' found
Supporting tesseract v3.03
Building with configs: {'libraries': ['tesseract', 'lept'], 'cython_compile_time_env': {'TESSERACT_VERSION': 771}}
skipping 'tesserocr.cpp' Cython extension (up-to-date)
building 'tesserocr' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c tesserocr.cpp -o build/temp.linux-x86_64-2.7/tesserocr.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
tesserocr.cpp: In function ‘PyObject* __pyx_pf_9tesserocr_14PyPageIterator_20SetBoundingBoxComponents(__pyx_obj_9tesserocr_PyPageIterator*, bool, bool)’:
tesserocr.cpp:4622:25: error: ‘class tesseract::PageIterator’ has no member named ‘SetBoundingBoxComponents’
__pyx_v_self->_piter->SetBoundingBoxComponents(__pyx_v_include_upper_dots, __pyx_v_include_lower_dots);
^
tesserocr.cpp: In function ‘PyObject* __pyx_pf_9tesserocr_14PyPageIterator_34GetImage(__pyx_obj_9tesserocr_PyPageIterator*, tesseract::PageIteratorLevel, int, PyObject*)’:
tesserocr.cpp:5854:125: error: no matching function for call to ‘tesseract::PageIterator::GetImage(tesseract::PageIteratorLevel&, int&, Pix*&, int*, int*)’
__pyx_v_pix = __pyx_v_self->_piter->GetImage(__pyx_v_level, __pyx_v_padding, __pyx_v_opix, (&__pyx_v_left), (&__pyx_v_top));
^
tesserocr.cpp:5854:125: note: candidate is:
In file included from tesserocr.cpp:456:0:
/usr/include/tesseract/pageiterator.h:239:8: note: Pix* tesseract::PageIterator::GetImage(tesseract::PageIteratorLevel, int, int*, int*) const
Pix* GetImage(PageIteratorLevel level, int padding,
^
/usr/include/tesseract/pageiterator.h:239:8: note: candidate expects 4 arguments, 5 provided
tesserocr.cpp: In function ‘PyObject* __pyx_pf_9tesserocr_13PyTessBaseAPI_74AnalyseLayout(__pyx_obj_9tesserocr_PyTessBaseAPI*, bool)’:
tesserocr.cpp:16256:83: error: no matching function for call to ‘tesseract::TessBaseAPI::AnalyseLayout(bool&)’
__pyx_v_piter = __pyx_v_self->_baseapi.AnalyseLayout(__pyx_v_merge_similar_words);
^
tesserocr.cpp:16256:83: note: candidate is:
In file included from tesserocr.cpp:461:0:
/usr/include/tesseract/baseapi.h:489:17: note: tesseract::PageIterator* tesseract::TessBaseAPI::AnalyseLayout()
PageIterator* AnalyseLayout();
^
/usr/include/tesseract/baseapi.h:489:17: note: candidate expects 0 arguments, 1 provided
tesserocr.cpp: In function ‘tesseract::TessResultRenderer* __pyx_f_9tesserocr_13PyTessBaseAPI__get_renderer(__pyx_obj_9tesserocr_PyTessBaseAPI*, __pyx_t_9tesseract_cchar_t*)’:
tesserocr.cpp:16600:88: error: no matching function for call to ‘tesseract::TessHOcrRenderer::TessHOcrRenderer(__pyx_t_9tesseract_cchar_t*&, bool&)’
__pyx_t_2 = new tesseract::TessHOcrRenderer(__pyx_v_outputbase, __pyx_v_font_info);
^
tesserocr.cpp:16600:88: note: candidates are:
In file included from tesserocr.cpp:459:0:
/usr/include/tesseract/renderer.h:175:3: note: tesseract::TessHOcrRenderer::TessHOcrRenderer()
TessHOcrRenderer();
^
/usr/include/tesseract/renderer.h:175:3: note: candidate expects 0 arguments, 2 provided
/usr/include/tesseract/renderer.h:173:16: note: tesseract::TessHOcrRenderer::TessHOcrRenderer(const tesseract::TessHOcrRenderer&)
class TESS_API TessHOcrRenderer : public TessResultRenderer {
^
/usr/include/tesseract/renderer.h:173:16: note: candidate expects 1 argument, 2 provided
tesserocr.cpp:16643:106: error: no matching function for call to ‘tesseract::TessPDFRenderer::TessPDFRenderer(__pyx_t_9tesseract_cchar_t*&, const char*)’
__pyx_t_3 = new tesseract::TessPDFRenderer(__pyx_v_outputbase, __pyx_v_self->_baseapi.GetDatapath());
^
tesserocr.cpp:16643:106: note: candidates are:
In file included from tesserocr.cpp:459:0:
/usr/include/tesseract/renderer.h:188:3: note: tesseract::TessPDFRenderer::TessPDFRenderer(const char*)
TessPDFRenderer(const char *datadir);
^
/usr/include/tesseract/renderer.h:188:3: note: candidate expects 1 argument, 2 provided
/usr/include/tesseract/renderer.h:186:16: note: tesseract::TessPDFRenderer::TessPDFRenderer(const tesseract::TessPDFRenderer&)
class TESS_API TessPDFRenderer : public TessResultRenderer {
^
/usr/include/tesseract/renderer.h:186:16: note: candidate expects 1 argument, 2 provided
tesserocr.cpp:16727:69: error: no matching function for call to ‘tesseract::TessUnlvRenderer::TessUnlvRenderer(__pyx_t_9tesseract_cchar_t*&)’
__pyx_t_4 = new tesseract::TessUnlvRenderer(__pyx_v_outputbase);
^
tesserocr.cpp:16727:69: note: candidates are:
In file included from tesserocr.cpp:459:0:
/usr/include/tesseract/renderer.h:227:3: note: tesseract::TessUnlvRenderer::TessUnlvRenderer()
TessUnlvRenderer();
^
/usr/include/tesseract/renderer.h:227:3: note: candidate expects 0 arguments, 1 provided
/usr/include/tesseract/renderer.h:225:16: note: tesseract::TessUnlvRenderer::TessUnlvRenderer(const tesseract::TessUnlvRenderer&)
class TESS_API TessUnlvRenderer : public TessResultRenderer {
^
/usr/include/tesseract/renderer.h:225:16: note: no known conversion for argument 1 from ‘__pyx_t_9tesseract_cchar_t* {aka const char*}’ to ‘const tesseract::TessUnlvRenderer&’
tesserocr.cpp:16811:72: error: no matching function for call to ‘tesseract::TessBoxTextRenderer::TessBoxTextRenderer(__pyx_t_9tesseract_cchar_t*&)’
__pyx_t_5 = new tesseract::TessBoxTextRenderer(__pyx_v_outputbase);
^
tesserocr.cpp:16811:72: note: candidates are:
In file included from tesserocr.cpp:459:0:
/usr/include/tesseract/renderer.h:238:3: note: tesseract::TessBoxTextRenderer::TessBoxTextRenderer()
TessBoxTextRenderer();
^
/usr/include/tesseract/renderer.h:238:3: note: candidate expects 0 arguments, 1 provided
/usr/include/tesseract/renderer.h:236:16: note: tesseract::TessBoxTextRenderer::TessBoxTextRenderer(const tesseract::TessBoxTextRenderer&)
class TESS_API TessBoxTextRenderer : public TessResultRenderer {
^
/usr/include/tesseract/renderer.h:236:16: note: no known conversion for argument 1 from ‘__pyx_t_9tesseract_cchar_t* {aka const char*}’ to ‘const tesseract::TessBoxTextRenderer&’
tesserocr.cpp:16895:69: error: no matching function for call to ‘tesseract::TessTextRenderer::TessTextRenderer(__pyx_t_9tesseract_cchar_t*&)’
__pyx_t_6 = new tesseract::TessTextRenderer(__pyx_v_outputbase);
^
tesserocr.cpp:16895:69: note: candidates are:
In file included from tesserocr.cpp:459:0:
/usr/include/tesseract/renderer.h:164:3: note: tesseract::TessTextRenderer::TessTextRenderer()
TessTextRenderer();
^
/usr/include/tesseract/renderer.h:164:3: note: candidate expects 0 arguments, 1 provided
/usr/include/tesseract/renderer.h:162:16: note: tesseract::TessTextRenderer::TessTextRenderer(const tesseract::TessTextRenderer&)
class TESS_API TessTextRenderer : public TessResultRenderer {
^
/usr/include/tesseract/renderer.h:162:16: note: no known conversion for argument 1 from ‘__pyx_t_9tesseract_cchar_t* {aka const char*}’ to ‘const tesseract::TessTextRenderer&’
tesserocr.cpp: In function ‘PyObject* __pyx_pf_9tesserocr_13PyTessBaseAPI_108IsValidCharacter(__pyx_obj_9tesserocr_PyTessBaseAPI*, PyObject*)’:
tesserocr.cpp:19661:60: error: ‘class tesseract::TessBaseAPI’ has no member named ‘IsValidCharacter’
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_baseapi.IsValidCharacter(__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2161, __pyx_L1_error)
^
tesserocr.cpp:544:36: note: in definition of macro ‘__Pyx_PyBool_FromLong’
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
^
tesserocr.cpp: In function ‘void inittesserocr()’:
tesserocr.cpp:25014:67: error: ‘PSM_RAW_LINE’ is not a member of ‘tesseract’
__pyx_t_2 = __Pyx_PyInt_From_enum__tesseract_3a__3a_PageSegMode(tesseract::PSM_RAW_LINE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-YcBV5a/tesserocr/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-KHSvyq-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-YcBV5a/tesserocr/
Faced this problem today. It happens because we are missing these libraries
libleptonica-dev and libtesseract-dev
Solution is to install them using your package manager.
Ubuntu
apt-get install libleptonica-dev libtesseract-dev
Mac
pip install tesserocr
will auto install tesserocr and its dependent lib leptonica
solved the issue
My error was like:
Failed building wheel for tesserocr
(...)
Supporting tesseract v4.0.0
Building with configs: {'libraries': ['tesseract', 'lept'], 'cython_compile_time_env': {'TESSERACT_VERSION': 67108864}}
(...)
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c tesserocr.cpp -o build/temp.linux-x86_64-3.6/tesserocr.o -std=c++11 -DUSE_STD_NAMESPACE
tesserocr.cpp: In function 'PyObject* __pyx_pf_9tesserocr_16PyResultIterator_8GetBestLSTMSymbolChoices(__pyx_obj_9tesserocr_PyResultIterator*)':
tesserocr.cpp:12192:43: error: 'class tesseract::ResultIterator' has no member named 'GetBestLSTMSymbolChoices'
__pyx_v_output = (__pyx_v_self->_riter->GetBestLSTMSymbolChoices()[0]);
^~~~~~~~~~~~~~~~~~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-s6f5ze1q/tesserocr/setup.py';
f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))"
install --record /tmp/pip-lopr6cjz-record/install-record.txt --single-version-externally-managed --compile"
failed with error code 1 in /tmp/pip-build-s6f5ze1q/tesserocr/
I resolved it with additional installation of pkg-config library.
apt-get install libleptonica-dev libtesseract-dev \
tesseract-ocr tesseract-ocr-eng \
pkg-config
If you are using a linux(Debian based like Ubuntu 14.04) system you would like to upgrade your Tesseract version. Apparently in Ubuntu 14.04 default Tesseract version is 3.03 which is not supported by tesserocr. You have to build from source with some newer Tesseract versions like 4.00 or 3.05.But in newer OS versions this should not be a problem.
Just follow the link for the installation
Installing Tesserocr with Tesseract 3.04+

tensorflow build fail at october 6 2016

Ubuntu 16.04
gcc 5.4.0
java 1.8.0_91
bazel 0.3.1 (download the releases , haven't build from source because it build fail)
I change the config file follow the discussion here and here because it works for ./configure.
I clone the lastest code and configure without GPU. Here is my build instruction at the root directory of tensorflow
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
The error log:
ERROR: /home/gt/.cache/bazel/_bazel_gt/3d5d29ec73796bda2fc5b2dffed26f47/external/protobuf/BUILD:333:1: Linking of rule '#protobuf//:protoc' failed: gcc failed: error executing command /usr/bin/gcc -o bazel-out/host/bin/external/protobuf/protoc -Wl,-no-as-needed -B/usr/bin -B/usr/bin -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,--gc-sections ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
bazel-out/host/bin/external/protobuf/_objs/protoc/external/protobuf/src/google/protobuf/compiler/main.o: In function `main':
main.cc:(.text.startup.main+0x2db): undefined reference to `vtable for google::protobuf::compiler::php::Generator'
main.cc:(.text.startup.main+0x642): undefined reference to `vtable for google::protobuf::compiler::php::Generator'
main.cc:(.text.startup.main+0x740): undefined reference to `vtable for google::protobuf::compiler::php::Generator'
collect2: error: ld returned 1 exit status
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
This is a bug in protobuf, we signaled it already two weeks ago. See https://github.com/google/protobuf/issues/2133

nettle-3.0 and gmp-6.0.0 - undefined symbols "gmpz_limbs_write, gmpz_limbs_read..."

I am trying to compile nettle 3.0 with gmp 6.0.0 and I kept getting missing symbols:
Making all in tools
gcc -g -O2 -ggdb3 -Wno-pointer-sign -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith -Wbad-function-cast -Wnested-externs -L.. pkcs1-conv.o misc.o ../getopt.o ../getopt1.o -lhogweed -lnettle -lgmp -o pkcs1-conv
ld: warning: relocation error: R_386_32: file ../getopt.o: symbol optarg: external symbolic relocation against non-allocatable section .debug_info; cannot be processed at runtime: relocation ignored
Undefined first referenced
symbol in file
__gmpz_limbs_write ../libhogweed.so
__gmpz_limbs_finish ../libhogweed.so
__gmpz_limbs_modify ../libhogweed.so
__gmpn_zero ../libhogweed.so
__gmpz_roinit_n ../libhogweed.so
__gmpn_cnd_sub_n ../libhogweed.so
__gmpn_cnd_add_n ../libhogweed.so
__gmpz_limbs_read ../libhogweed.so
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `pkcs1-conv'
Current working directory /root/nettle-3.0/tools
I installed gmp 6.0.0 to /usr/local, then - in the nettle directory -, I ran ./configure --prefix=/usr/local, then make and got the error above.
It looks nettle is finding an older version first. Have you tried?
./configure --prefix=/usr/local --with-include-path=/usr/local/include --with-lib-path=/usr/local/lib
I found the options by using ./configure --help.