问题
I am trying to install pdftotext on windows:
pip install pdftotext
It failed originally because of lack of MS visual studio (now installed) and now it fails with a poppler problem. I have downloaded poppler and it is installed in
C:\Program Files (x86)\poppler
my path includes this directory.
The install fails with an error
I cannot find the file poppler-cpp.lib in Program Files (x86)
I know that installing poppler is problematic and there are many questions on the web relating to it and one seems to be my problem exactly (mark on 19 July 2018), but no solution seems to have been offered. I have it installed on linux and it works like a dream. But, I need to have working on Windows too.
Can someone please help me to sort this out?
[EDIT 2018.09.17 I have found a reference to it here:
... The problem was that this binaries files were dynamic and, from the files with .lib extension (poppler.lib, poppler-cpp.lib, poppler-qt4.lib), only poppler.lib was a static library. Due to this, and using the cMake files content in the download of the source code of poppler I tried to generate static versions from all the dependencies of poppler, which was an easy thing to do ...
Does this help someone to come to my aid?
回答1:
I struggled with exactly the same and wasn't able to compile a solution.
A workaround I'm using is running pdftotext.exe which is installed with miktex 2.9 (I'm already using this for latex).
Identify the path to pdftotext.exe after installing miktex. Then you can run it with the subprocess module.
Import subprocess
Subprocess.call([path/pdftotext.exe,
options, file.pdf])
Switch options with the option you need.
来源:https://stackoverflow.com/questions/52336495/cannot-install-pdftotext-on-windows-because-of-poppler