2017-04-10 30 views
5

Tôi đã có xây dựng mới nhất cho leptonica và Tesseractpips cài đặt tesserocr thất bại với lỗi "bánh xe xây dựng Không cho tesserocr"

tesseract 4.00.00alpha-365-gcf0b378 
leptonica-1.74.1 
    libjpeg 8d (libjpeg-turbo 1.3.0) : libpng 1.2.50 : libtiff 4.0.3 : zlib 1.2.8 

tôi cũng đã cài đặt tất cả phụ thuộc như python-dev

Lỗi này tôi nhận được khi tôi cài đặt pip tesserocr trong số virtualenv

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/ajay/virtualenvs/v2/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-L3JmI9/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/tmpUIPX1spip-wheel- --python-tag cp27: 
     running bdist_wheel 
     running build 
     running build_ext 
     Supporting tesseract v4.00.00dev 
     Configs from pkg-config: {'libraries': ['lept', 'tesseract'], 'cython_compile_time_env': {'TESSERACT_VERSION': 262144}, 'library_dirs': ['/usr/local/lib'], 'include_dirs': ['/usr/local/include']} 
     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 -I/usr/local/include -fPIC -I/usr/local/include -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] 
     In file included from /usr/local/include/tesseract/genericvector.h:29:0, 
         from tesserocr.cpp:449: 
     /usr/local/include/tesseract/helpers.h: In member function ‘void tesseract::TRand::set_seed(const string&)’: 
     /usr/local/include/tesseract/helpers.h:50:5: error: ‘hash’ is not a member of ‘std’ 
      std::hash<std::string> hasher; 
     ^
     /usr/local/include/tesseract/helpers.h:50:26: error: expected primary-expression before ‘>’ token 
      std::hash<std::string> hasher; 
           ^
     /usr/local/include/tesseract/helpers.h:50:28: error: ‘hasher’ was not declared in this scope 
      std::hash<std::string> hasher; 
           ^
     tesserocr.cpp: In function ‘tesseract::TessResultRenderer* __pyx_f_9tesserocr_13PyTessBaseAPI__get_renderer(__pyx_obj_9tesserocr_PyTessBaseAPI*, __pyx_t_9tesseract_cchar_t*)’: 
     tesserocr.cpp:16699:106: error: no matching function for call to ‘tesseract::TessPDFRenderer::TessPDFRenderer(__pyx_t_9tesseract_cchar_t*&, const char*)’ 
      __pyx_t_7 = new tesseract::TessPDFRenderer(__pyx_v_outputbase, __pyx_v_self->_baseapi.GetDatapath()); 
                               ^
     tesserocr.cpp:16699:106: note: candidates are: 
     In file included from tesserocr.cpp:459:0: 
     /usr/local/include/tesseract/renderer.h:190:3: note: tesseract::TessPDFRenderer::TessPDFRenderer(const char*, const char*, bool) 
     TessPDFRenderer(const char* outputbase, const char* datadir, bool textonly); 
     ^
     /usr/local/include/tesseract/renderer.h:190:3: note: candidate expects 3 arguments, 2 provided 
     /usr/local/include/tesseract/renderer.h:186:16: note: tesseract::TessPDFRenderer::TessPDFRenderer(const tesseract::TessPDFRenderer&) 
     class TESS_API TessPDFRenderer : public TessResultRenderer { 
        ^
     /usr/local/include/tesseract/renderer.h:186:16: note: candidate expects 1 argument, 2 provided 
     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/ajay/virtualenvs/v2/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-L3JmI9/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-6eGBXb-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ajay/virtualenvs/v2/include/site/python2.7/tesserocr: 
     running install 
     running build 
     running build_ext 
     Supporting tesseract v4.00.00dev 
     Configs from pkg-config: {'libraries': ['lept', 'tesseract'], 'cython_compile_time_env': {'TESSERACT_VERSION': 262144}, 'library_dirs': ['/usr/local/lib'], 'include_dirs': ['/usr/local/include']} 
     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 -I/usr/local/include -fPIC -I/usr/local/include -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] 
     In file included from /usr/local/include/tesseract/genericvector.h:29:0, 
         from tesserocr.cpp:449: 
     /usr/local/include/tesseract/helpers.h: In member function ‘void tesseract::TRand::set_seed(const string&)’: 
     /usr/local/include/tesseract/helpers.h:50:5: error: ‘hash’ is not a member of ‘std’ 
      std::hash<std::string> hasher; 
      ^
     /usr/local/include/tesseract/helpers.h:50:26: error: expected primary-expression before ‘>’ token 
      std::hash<std::string> hasher; 
           ^
     /usr/local/include/tesseract/helpers.h:50:28: error: ‘hasher’ was not declared in this scope 
      std::hash<std::string> hasher; 
            ^
     tesserocr.cpp: In function ‘tesseract::TessResultRenderer* __pyx_f_9tesserocr_13PyTessBaseAPI__get_renderer(__pyx_obj_9tesserocr_PyTessBaseAPI*, __pyx_t_9tesseract_cchar_t*)’: 
     tesserocr.cpp:16699:106: error: no matching function for call to ‘tesseract::TessPDFRenderer::TessPDFRenderer(__pyx_t_9tesseract_cchar_t*&, const char*)’ 
       __pyx_t_7 = new tesseract::TessPDFRenderer(__pyx_v_outputbase, __pyx_v_self->_baseapi.GetDatapath()); 
                               ^
     tesserocr.cpp:16699:106: note: candidates are: 
     In file included from tesserocr.cpp:459:0: 
     /usr/local/include/tesseract/renderer.h:190:3: note: tesseract::TessPDFRenderer::TessPDFRenderer(const char*, const char*, bool) 
      TessPDFRenderer(const char* outputbase, const char* datadir, bool textonly); 
     ^
     /usr/local/include/tesseract/renderer.h:190:3: note: candidate expects 3 arguments, 2 provided 
     /usr/local/include/tesseract/renderer.h:186:16: note: tesseract::TessPDFRenderer::TessPDFRenderer(const tesseract::TessPDFRenderer&) 
     class TESS_API TessPDFRenderer : public TessResultRenderer { 
         ^
     /usr/local/include/tesseract/renderer.h:186:16: note: candidate expects 1 argument, 2 provided 
     error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

tôi nhận được lỗi này ở dưới cùng

 ---------------------------------------- 
    Command "/home/ajay/virtualenvs/v2/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-L3JmI9/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-6eGBXb-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ajay/virtualenvs/v2/include/site/python2.7/tesserocr" failed with error code 1 in /tmp/pip-build-L3JmI9/tesserocr/ 
+0

bạn có giải pháp không? –

+0

nếu bạn đang chạy ubuntu 14.04 hãy thử xây dựng tesseract 3.04 từ nguồn nó làm việc cho tôi – ajack13

+0

Đã cố gắng nhưng điều này đã không làm việc. –

Trả lời

1

Cuối cùng cố định vấn đề này

Tesseract loại bỏ hoàn toàn và leptonica từ hệ thống và xây dựng mọi thứ từ nguồn

sự gói debian leptonica-dev cho ubuntu 14.04 là vấn đề

đây là những bản dựng hiện tại tôi đã biên soạn

$ tesseract -v 
tesseract 3.04.01 
leptonica-1.74.1 
    libjpeg 8d (libjpeg-turbo 1.3.0) : libpng 1.2.50 : libtiff 4.0.3 : zlib 1.2.8 
Các vấn đề liên quan