Giter Club home page Giter Club logo

Comments (24)

jalan avatar jalan commented on September 25, 2024 12

Since this project uses poppler's CPP interface, you also need the libpoppler-cpp-dev package

from pdftotext.

jalan avatar jalan commented on September 25, 2024 2

@lhyGit libpoppler-cpp-dev is one of the packages needed on Debian-based systems. For macOS, the packages you need are installed via brew install pkg-config poppler

If you still have issues after installing those, can you provide the output of pip --verbose install pdftotext here?

from pdftotext.

nazreen avatar nazreen commented on September 25, 2024 2

I'm using this in a Dockerized environment and simply doing apt-get install libpoppler-cpp-dev did it for me
thanks @jalan !

from pdftotext.

jalan avatar jalan commented on September 25, 2024 1

@GD-A-150800 Please don't post new unrelated questions on a closed issue.

I'm sorry to say that there is no support for Windows. The relevant issue in this case is #16.

from pdftotext.

Ciangi avatar Ciangi commented on September 25, 2024 1
Collecting pdftotext
  Using cached https://files.pythonhosted.org/packages/21/35/60094dbadd9de2035873390b1cac25e01da605844eba6a07a53a82fa4adc/pdftotext-2.1.1.tar.gz
Building wheels for collected packages: pdftotext
  Building wheel for pdftotext (setup.py) ... error
  ERROR: Complete output from command /usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-O5algo/pdftotext/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/pip-wheel-oMHm6f --python-tag cp27:
  ERROR: running bdist_wheel
  running build
  running build_ext
  building 'pdftotext' 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 -DPOPPLER_CPP_AT_LEAST_0_30_0=1 -I/usr/include/python2.7 -c pdftotext.cpp -o build/temp.linux-x86_64-2.7/pdftotext.o -Wall
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  In file included from pdftotext.cpp:5:0:
  /usr/local/include/poppler/cpp/poppler-page.h:39:22: error: expected ‘,’ or ‘...’ before ‘&&’ token
       text_box(text_box&&);
                        ^
  /usr/local/include/poppler/cpp/poppler-page.h:39:24: error: invalid constructor; you probably meant ‘poppler::text_box (const poppler::text_box&)’
       text_box(text_box&&);
                          ^
  /usr/local/include/poppler/cpp/poppler-page.h:40:33: error: expected ‘,’ or ‘...’ before ‘&&’ token
       text_box& operator=(text_box&&);
                                   ^
  /usr/local/include/poppler/cpp/poppler-page.h:70:10: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
       std::unique_ptr<text_box_data> m_data;
            ^
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pdftotext
  Running setup.py clean for pdftotext
Failed to build pdftotext
Installing collected packages: pdftotext
  Running setup.py install for pdftotext ... error
    ERROR: Complete output from command /usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-O5algo/pdftotext/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-record-TF1_ts/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_ext
    building 'pdftotext' 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 -DPOPPLER_CPP_AT_LEAST_0_30_0=1 -I/usr/include/python2.7 -c pdftotext.cpp -o build/temp.linux-x86_64-2.7/pdftotext.o -Wall
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    In file included from pdftotext.cpp:5:0:
    /usr/local/include/poppler/cpp/poppler-page.h:39:22: error: expected ‘,’ or ‘...’ before ‘&&’ token
         text_box(text_box&&);
                          ^
    /usr/local/include/poppler/cpp/poppler-page.h:39:24: error: invalid constructor; you probably meant ‘poppler::text_box (const poppler::text_box&)’
         text_box(text_box&&);
                            ^
    /usr/local/include/poppler/cpp/poppler-page.h:40:33: error: expected ‘,’ or ‘...’ before ‘&&’ token
         text_box& operator=(text_box&&);
                                     ^
    /usr/local/include/poppler/cpp/poppler-page.h:70:10: error: ‘unique_ptr’ in namespace ‘std’ does not name a template type
         std::unique_ptr<text_box_data> m_data;
              ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/usr/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-O5algo/pdftotext/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-record-TF1_ts/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-O5algo/pdftotext/

from pdftotext.

jalan avatar jalan commented on September 25, 2024

Are the poppler dev libraries installed?

from pdftotext.

johndurning avatar johndurning commented on September 25, 2024

I think so.

john@john-Virtual-Machine:~$ dpkg -l | grep poppler
ii  libpoppler-glib8:amd64  0.62.0-2ubuntu2.2  amd64   PDF rendering library (GLib-based shared library)
ii  libpoppler73:amd64  0.62.0-2ubuntu2.2  amd64   PDF rendering library
ii  poppler-data  0.4.8-2  all  encoding data for the poppler PDF rendering library
ii  poppler-utils  0.62.0-2ubuntu2.2  amd64  PDF utilities (based on Poppler)

That should be ok, shouldn't it?

from pdftotext.

johndurning avatar johndurning commented on September 25, 2024

Great, that worked. Thanks!

from pdftotext.

lhyGit avatar lhyGit commented on September 25, 2024

I had the same error on macOS. Also I don't find any way to install the libpoppler-cpp-dev package on macOS. I tried brew search libpoppler, but no such formula or related formulae exist. Any help would be greatly appreciated.

from pdftotext.

lhyGit avatar lhyGit commented on September 25, 2024

It's interesting that I actually have the header file 'poppler-document.h' under the poppler path, which is '/usr/local/Cellar/poppler/0.71.0/include/poppler/cpp/poppler-document.h'. I think the compiler gcc couldn't find the header file for some reason but I don't know why specifically. Any ideas?

from pdftotext.

jalan avatar jalan commented on September 25, 2024

Reopening so I don't lose track of this

from pdftotext.

lhyGit avatar lhyGit commented on September 25, 2024

output.txt
Thanks for replying. This is the output of pip install. The compiler just couldn't find 'poppler-document.h', but it's actually under the poppler path.

from pdftotext.

jalan avatar jalan commented on September 25, 2024

It looks like you're using anaconda, which is known to provide a strange build environment. Can you try to first install poppler via anaconda and then pip install pdftotext again? https://anaconda.org/conda-forge/poppler

from pdftotext.

jalan avatar jalan commented on September 25, 2024

Closing after no response for ten days. Will reopen if further information is provided.

from pdftotext.

thsunkid avatar thsunkid commented on September 25, 2024

Hi jalan,

I have same issue in pdftotext version 2.1.1 in MacOS when install from pip: pip install pdftotext.

Collecting pdftotext
Using cached https://files.pythonhosted.org/packages/21/35/60094dbadd9de2035873390b1cac25e01da605844eba6a07a53a82fa4adc/pdftotext-2.1.1.tar.gz
Building wheels for collected packages: pdftotext
Running setup.py bdist_wheel for pdftotext ... error
Complete output from command /Users/thesunkid/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/0h/fhqgpcw54h14k55y7wz6yyvr0000gn/T/pip-install-b1ig7hrs/pdftotext/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 /private/var/folders/0h/fhqgpcw54h14k55y7wz6yyvr0000gn/T/pip-wheel-9fekba4s --python-tag cp36:
/Users/thesunkid/anaconda3/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running bdist_wheel
running build
running build_ext
building 'pdftotext' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/thesunkid/anaconda3/include -arch x86_64 -I/Users/thesunkid/anaconda3/include -arch x86_64 -DPOPPLER_CPP_AT_LEAST_0_30_0=1 -I/Users/thesunkid/anaconda3/include/python3.6m -c pdftotext.cpp -o build/temp.macosx-10.7-x86_64-3.6/pdftotext.o -Wall -mmacosx-version-min=10.9
In file included from pdftotext.cpp:5:
/usr/local/include/poppler/cpp/poppler-page.h:39:22: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
text_box(text_box&&);
^
/usr/local/include/poppler/cpp/poppler-page.h:40:33: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
text_box& operator=(text_box&&);
^
2 warnings generated.
creating build/lib.macosx-10.7-x86_64-3.6
g++ -bundle -undefined dynamic_lookup -L/Users/thesunkid/anaconda3/lib -arch x86_64 -L/Users/thesunkid/anaconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/pdftotext.o -lpoppler-cpp -o build/lib.macosx-10.7-x86_64-3.6/pdftotext.cpython-36m-darwin.so
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1

Failed building wheel for pdftotext
Running setup.py clean for pdftotext
Failed to build pdftotext
Installing collected packages: pdftotext
Running setup.py install for pdftotext ... error
Complete output from command /Users/thesunkid/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/0h/fhqgpcw54h14k55y7wz6yyvr0000gn/T/pip-install-b1ig7hrs/pdftotext/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/0h/fhqgpcw54h14k55y7wz6yyvr0000gn/T/pip-record-0e3hxpvj/install-record.txt --single-version-externally-managed --compile:
/Users/thesunkid/anaconda3/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_ext
building 'pdftotext' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/thesunkid/anaconda3/include -arch x86_64 -I/Users/thesunkid/anaconda3/include -arch x86_64 -DPOPPLER_CPP_AT_LEAST_0_30_0=1 -I/Users/thesunkid/anaconda3/include/python3.6m -c pdftotext.cpp -o build/temp.macosx-10.7-x86_64-3.6/pdftotext.o -Wall -mmacosx-version-min=10.9
In file included from pdftotext.cpp:5:
/usr/local/include/poppler/cpp/poppler-page.h:39:22: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
text_box(text_box&&);
^
/usr/local/include/poppler/cpp/poppler-page.h:40:33: warning: rvalue references are a C++11 extension [-Wc++11-extensions]
text_box& operator=(text_box&&);
^
2 warnings generated.
creating build/lib.macosx-10.7-x86_64-3.6
g++ -bundle -undefined dynamic_lookup -L/Users/thesunkid/anaconda3/lib -arch x86_64 -L/Users/thesunkid/anaconda3/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/pdftotext.o -lpoppler-cpp -o build/lib.macosx-10.7-x86_64-3.6/pdftotext.cpython-36m-darwin.so
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1

Command "/Users/thesunkid/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/0h/fhqgpcw54h14k55y7wz6yyvr0000gn/T/pip-install-b1ig7hrs/pdftotext/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/0h/fhqgpcw54h14k55y7wz6yyvr0000gn/T/pip-record-0e3hxpvj/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/0h/fhqgpcw54h14k55y7wz6yyvr0000gn/T/pip-install-b1ig7hrs/pdftotext/

I've tried several times but it still doesn't work. Can you make any suggestion?

from pdftotext.

GD-A-150800 avatar GD-A-150800 commented on September 25, 2024

I am not able to install libpoppler-cpp-dev in anaconda environment on windows.
What should i do?
I get this message:
conda install libpoppler-cpp-dev
Collecting package metadata: done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  • libpoppler-cpp-dev

Current channels:

To search for alternate channels that may provide the conda package you're
looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.

from pdftotext.

YuhangTsim avatar YuhangTsim commented on September 25, 2024

output.log
/usr/local/opt/poppler/include/poppler/cpp/poppler-page.h:39:22: error: expected ‘,’ or ‘...’ before ‘&&’ token
text_box(text_box&&);
^
/usr/local/opt/poppler/include/poppler/cpp/poppler-page.h:39:24: error: invalid constructor; you probably meant ‘poppler::text_box (const poppler::text_box&)’
text_box(text_box&&);
^
/usr/local/opt/poppler/include/poppler/cpp/poppler-page.h:40:33: error: expected ‘,’ or ‘...’ before ‘&&’ token
text_box& operator=(text_box&&);
^
/usr/local/opt/poppler/include/poppler/cpp/poppler-page.h:70:5: error: ‘unique_ptr’ in namespace ‘std’ does not name a type
std::unique_ptr<text_box_data> m_data;

from pdftotext.

jalan avatar jalan commented on September 25, 2024

@Ciangi what system are you building on?

from pdftotext.

Ciangi avatar Ciangi commented on September 25, 2024

Ubuntu 16.04
python2.7

from pdftotext.

jalan avatar jalan commented on September 25, 2024

I just booted into a fresh Ubuntu 16.04 machine and it installed just fine.

Your system looks fishy. Poppler headers on Ubuntu are usually in /usr/include, not /usr/local/include. Did you manually install poppler instead of using the one provided by Ubuntu?

from pdftotext.

Ciangi avatar Ciangi commented on September 25, 2024

I manually installed poppler. but i noticed that i have pdftotext installed, don't know why but it is and works ...

from pdftotext.

owen9825 avatar owen9825 commented on September 25, 2024

I ended up having to uninstall linuxbrew. I started suspecting this to be the issue after seeing that the the header was in the linuxbrew path:

/home/linuxbrew/.linuxbrew/include/poppler/cpp/poppler-page.h:38:15: error: does not match expected signature 'poppler::text_box& poppler::text_box::operator=(poppler::text_box&)'
error: command 'gcc' failed with exit status 1
----------------------------------------

from pdftotext.

DarpanDRaj avatar DarpanDRaj commented on September 25, 2024

I'm using this in a Dockerized environment and simply doing apt-get install libpoppler-cpp-dev did it for me
thanks @jalan !

This is the proper one for ubuntu users using python3

from pdftotext.

akhidwivedi avatar akhidwivedi commented on September 25, 2024

what to be done if same issues are appearing in windows????

from pdftotext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.