-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot install on Windows #16
Comments
You would need to get poppler and its development files installed on Windows. I don't use Windows, so I am not much help, sorry. If you figure something out, I will gladly add it to the README here! |
Thanks. I am researching this but have not found any good guidance. I will report back my findings. |
Any updates on this problem? I happen to have this same thing. |
No, I didn’t. My solution ended up being in a completely different direction, using different packages. This may be worth a mention in the README file for future Windows (10) users. |
All hope is not lost on the windows version. There is a command line utility with the same name and you can use the subprocess package to execute pdftotext PDFtotext windows download instruction, credit @s2t2
|
You mean that it can be used from windows command prompt but not python? |
just copy files bin64/*.exe to your PYTHON PATH directory,then it can be used both cmd and python shell |
Any chance of prebuilt binaries being offered? Is it something that could be integrated into the CI setup? I think we'd need to build windows binaries on windows though, so moving to Appveyor would be required, unfortunately. Maybe a solution like cibuildwheel can help with that. I tried to, and failed miserably, at building it on windows. Considering the only alternative at the moment (pdfminer and it's deraritives), which is super slow (4 orders of magnitude in my experience), inaccurate results which are in some cases impossible to parse accurately, I think It'd be great to offer prebuilt binaries with this functionality. |
I "ugly" installed pdftotext successfully on windows three times over the past two days, as the subprocess method is a non-starter for me. I have a writeup on SO as well as on my blog, which has screenshots https://coder.haus/2019/09/27/installing-pdftotext-through-pip-on-windows-10/ Please try this, let me know if it works. I'm hoping to take time to do it properly and potentially generate a PR. My solution requires Anaconda (for conda install). First, install Microsoft VC++ build tools, download poppler for windows as well as conda install poppler, and copy some of the poppler files to different locations in the Anaconda directory structure. Again, I have done this a total of 3 times and know it can be done better, but this will get you up and running. |
The following fixes the issue on Windows 10. Assumes MS VC++ Build Tools is installed. The code update is in setup.py -
pip install completes successfully and the unit tests run successfully. Let me know if this looks sane, and if I should create a PR for this. |
I needed to apply this diff, then it worked for me: diff --git a/setup.py b/setup.py
index 4c0e861..8a7337a 100644
--- a/setup.py
+++ b/setup.py
@@ -29,8 +29,8 @@ elif platform.system() in ["Windows"]:
print("ERROR: CONDA_PREFIX is not found.")
print(" Install Anaconda or fix missing CONDA_PREFIX and try again.")
sys.exit(1)
- anaconda_poppler_include_dir = path.join(conda_dir, "Library\include")
- anaconda_poppler_library_dir = path.join(conda_dir, "Library\lib")
+ anaconda_poppler_include_dir = path.join(conda_dir, r"Library\include")
+ anaconda_poppler_library_dir = path.join(conda_dir, r"Library\lib")
include_dirs = [anaconda_poppler_include_dir]
library_dirs = [anaconda_poppler_library_dir]
else: |
@zacps I don't understand what your diff changes. Does it just change the strings into raw strings, or am I missing something? There are no escape characters, so aren't both versions equal?
|
|
Thank you so much @woodsjs for your blog post! Just a quick update I would add: |
Thanks for this, @Kagigz! I've updated the post to point to the possibility of the file living in the Python/Python{PythonVersion}/libs directory. |
@woodsjs I finally set up appveyor and pushed a release including your changes from #47: https://pypi.org/project/pdftotext/2.1.3/ . I hope it's nicer for Windows/conda users now. Thanks again! |
@jalan It looks like you have yet to upload the Windows binaries to pypi so Windows users can get them! |
I didn't say I was planning to upload any Windows binaries |
" I finally set up appveyor and pushed a release including your changes from #47: https://pypi.org/project/pdftotext/2.1.3/ . I hope it's nicer for Windows/conda users now." If you are not planning to upload any Windows binaries then the improvement for windows users is minimal - most do not have a compiler installed. |
I have had the hardest time installing pdftotext on my windows 10. Found @woodsjs page very useful as those were the exact errors I got. Finally I got it successfully installed but my PyCharm is not recognizing and giving : I see inside site-packages that pip install doesn't download the jar file, maybe that is the problem. Please please someone help me out. Spent 2 days on this thing. @jalan |
@palakjadwani this is the problem with there not being a binary download for the pdtotext package - you can find some workarounds at http://faculty.washington.edu/jwilker/559/2018/pdftotext.pdf but they are less than ideal. |
@palakjadwani If you can see the package using the anaconda prompt (you can, correct?), this more than likely has NOTHING to do with the install of pdftotext. This is most likely because your pycharm install is not using the interpreter, conda, that you installed pdftotext under. See Jetbrains documentation on changing your interpreter https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html?_ga=2.75189201.2125986240.1606050657-56391306.1606050657#interpreter You would add your existing anaconda environment. I've tested this, as I do not use PyCharm, and was able to add my anaconda environment and get access to pdftotext. I would also suggest shutting pycharm down and restarting to make the new interpreter active. |
I have the wheel file of the pdftotext for cp38 version 3.8.5 64 bit. I am also attaching poppler files so you can extract these files in python destination folder. |
If any one have the wheel of pdftotext of version cp39 64 bit kindly share it. |
Now I have the latest wheel file. version 39 64 Bit |
Hey! I have come across the following while trying to install it:
Do you have any idea what could be causing this? Any help would be greatly appreciated. |
There is possibly the error in the environment.
Try to run it in anaconda Or install it in anaconda prompt.
If the problem persists then you can use PyPDF2 as the pdf extractor.
Else There could be issues in the installation of poppler.
I am also finding the solution.
You can also refer to the Coder Haus blog on this.
If you find the solution then please let me know.
…On Mon, 18 Jan 2021 at 16:32, polyspastos ***@***.***> wrote:
*Hey!*
I have come across the following while trying to install it:
(venv) (dir)>python -m pip install ./pdftotext-2.1.5-cp39-cp39-win_amd64.whl
Processing (dir)\pdftotext-2.1.5-cp39-cp39-win_amd64.whl
Installing collected packages: pdftotext
Successfully installed pdftotext-2.1.5
(venv) (dir)>python (script).py
Traceback (most recent call last):
File "(dir)\(script).py", line 11, in <module>
import pdftotext
ImportError: DLL load failed while importing pdftotext: The specified module could not be found.
(venv) (dir)>pip freeze
(misc modules)
pdftotext @ file:///(drive):/(dir)/pdftotext-2.1.5-cp39-cp39-win_amd64.whl
(misc modules)
Do you have any idea what could be causing this?
Any help would be greatly appreciated.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#16 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASLD7K2H27CNGAE63DBLUNTS2QILHANCNFSM4EV2LW6A>
.
|
I suspect that you need to have the poppler bin directory on your path for it to work. This is probably why the pdftotext.zip that had the wheel in also had poppler-0.68.0_x86 (1).7z in it. You will need to use 7-zip to extract this and add the_location_that_you_extract_to\bin to your path.
Hope that helps.
From: GodMakesMe <notifications@github.com>
Sent: 18 January 2021 12:26
To: jalan/pdftotext <pdftotext@noreply.github.com>
Cc: Steve (Gadget) Barnes <gadgetsteve@hotmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [jalan/pdftotext] Cannot install on Windows (#16)
There is possibly the error in the environment.
Try to run it in anaconda Or install it in anaconda prompt.
If the problem persists then you can use PyPDF2 as the pdf extractor.
Else There could be issues in the installation of poppler.
I am also finding the solution.
You can also refer to the Coder Haus blog on this.
If you find the solution then please let me know.
On Mon, 18 Jan 2021 at 16:32, polyspastos ***@***.******@***.***>> wrote:
*Hey!*
I have come across the following while trying to install it:
(venv) (dir)>python -m pip install ./pdftotext-2.1.5-cp39-cp39-win_amd64.whl
Processing (dir)\pdftotext-2.1.5-cp39-cp39-win_amd64.whl
Installing collected packages: pdftotext
Successfully installed pdftotext-2.1.5
(venv) (dir)>python (script).py
Traceback (most recent call last):
File "(dir)\(script).py", line 11, in <module>
import pdftotext
ImportError: DLL load failed while importing pdftotext: The specified module could not be found.
(venv) (dir)>pip freeze
(misc modules)
pdftotext @ file:///(drive):/(dir)/pdftotext-2.1.5-cp39-cp39-win_amd64.whl
(misc modules)
Do you have any idea what could be causing this?
Any help would be greatly appreciated.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#16 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASLD7K2H27CNGAE63DBLUNTS2QILHANCNFSM4EV2LW6A>
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#16 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABKVUWROKGAJJDZRJS5TIIDS2QSEZANCNFSM4EV2LW6A>.
|
You can try latest version of poppler and extract the files according to the folders destination |
I've had some trouble getting pdftotext working on Windows. download poppler: https://anaconda.org/conda-forge/poppler/21.03.0/download/win-64/poppler-21.03.0-h9ff6ed8_0.tar.bz2 Copy the DLLs to ..<Python-install-folder>\Lib\site-packages Now you can install pdftotext with: Files are in attachment P.S. It would be great if the Poppler PDF rendering library based would be upgraded from the xpdf-3.0 to the xpdf-4.03 code base. |
Would needing to in stall Poppler also effect users of the software, if they're running a compiled application that uses this package? |
That depends on how you compile and distribute your application, of course. For example, on linux, you could bundle any needed shared libs with your app and start the app with an appropriate |
Using pyinstaller on Windows the Poppler DLLs are packed in the executable. Using the poppler v21.10 the lcms2 DLL is needed (lcms color engine) Updated DLL package: |
I am running Win10 with the anaconda dist of python 3.6 and have the MS build tools and compiler installed. I pip install the pdftotext package. Installation begins and then terminates with this message:
Any ideas?
The text was updated successfully, but these errors were encountered: