cbrunet / python-poppler

Python binding to Poppler-cpp pdf library
GNU General Public License v2.0
99 stars 15 forks source link

Not able to install poppler on google colab. #28

Closed keshav-qubitrics closed 3 years ago

keshav-qubitrics commented 3 years ago

Hi everyone,

I am trying to install poppler on Google Colaboratory. I am getting the following error:

ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-trbzri3i/python-poppler/setup.py'"'"'; file='"'"'/tmp/pip-install-trbzri3i/python-poppler/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-20uytqm_/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Any idea how to solve this or how to install poppler on Google Colab. I have tried to install using git option too. Still not able to install. I get the following error while trying to install using git:

-- Configuring incomplete, errors occurred! See also "/content/python-poppler/build/temp.linux-x86_64-3.7/CMakeFiles/CMakeOutput.log". Traceback (most recent call last): File "setup.py", line 106, in zip_safe=False, File "/usr/local/lib/python3.7/dist-packages/setuptools/init.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/local/lib/python3.7/dist-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/usr/local/lib/python3.7/dist-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/local/lib/python3.7/dist-packages/setuptools/command/bdist_egg.py", line 164, in run cmd = self.call_command('install_lib', warn_dir=0) File "/usr/local/lib/python3.7/dist-packages/setuptools/command/bdist_egg.py", line 150, in call_command self.run_command(cmdname) File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/local/lib/python3.7/dist-packages/setuptools/command/install_lib.py", line 11, in run self.build() File "/usr/lib/python3.7/distutils/command/install_lib.py", line 109, in build self.run_command('build_ext') File "/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "setup.py", line 39, in run self.build_extension(ext) File "setup.py", line 69, in build_extension ["cmake", ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env File "/usr/lib/python3.7/subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '/content/python-poppler', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/content/python-poppler/build/lib.linux-x86_64-3.7/poppler/cpp', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

Thank you in advance.

cbrunet commented 3 years ago

It is difficult to help you without more info. I doubt you will be able to install python-poppler on Google Colab before I provide a packaged binary version. There are many requirements to be able to build it.

The second trace shows that the cmake command failed. Again, it is difficult to know why without more information. Is libpoppler installed on the system?

cbrunet commented 3 years ago

I'm closing this, since you didn't gave me more information. Feel free to reopen it if you have further information.

dlmiles commented 1 year ago
!apt-get install poppler-utils libpoppler-cpp-dev
!pip install -v -v python-poppler
!pip install pdf2image

I think your issue was not using "-v -v " to see the reason for the failure. Then seeing ERROR: Dependency "poppler-cpp" not found, tried pkgconfig So install libpoppler-cpp-dev should resolve this.

Remove the -v -v if you want, pdf2image is optional.

HTH