Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'No module named pdf2image'
#1
Hmmm.... Perhaps another language is suitable to simply convert a pdf to an image?

I've gone through the loops of installing the poppler binary, pdf2image libraries. System path variables set for poppler and pdf2image.

Running my code, cannot import pdf2image. Ideas?
Reply
#2
Quote:Running my code, cannot import pdf2image. Ideas?
How did you install pdf2image? The good way is probably with pip
Output:
python -m pip install pdf2image
Reply
#3
Hi,

Yes i installed with pip.

That is what is frustrating me.

running your pip command it states that both PDF2Image and Pillow requirements already satisfied.

They are installed. But my code will not import them.

Thanks

Regards
Reply
#4
What is the output of
Output:
python -m pip show pdf2image
?
Reply
#5
Hi, here is output:
C:\Windows\System32>python -m pip install pdf2image
Requirement already satisfied: pdf2image in c:\users\USERNAME\appdata\local\programs\python\python37\lib\site-packages (1.6.0)
Requirement already satisfied: pillow in c:\users\USERNAME\appdata\local\programs\python\python37\lib\site-packages (from pdf2image) (6.1.0)
Reply
#6
I mean pip show, not pip install... It should give us some information about the package.

Also what is the output of
Output:
python -c "import sys; print(sys.path)"
?
Reply
#7
Hi sorry i did not read well enough:

C:\Windows\System32>python -m pip show pdf2image
Name: pdf2image
Version: 1.6.0
Summary: A wrapper around the pdftoppm and pdftocairo command line tools to convert PDF to a PIL Image list.
Home-page: https://github.com/Belval/pdf2image
Author: Edouard Belval
Author-email: [email protected]
License: MIT
Location: c:\users\brian\appdata\local\programs\python\python37\lib\site-packages
Requires: pillow
Required-by:
Reply
#8
There must be something wrong with sys.path. Can we see the output of
python -c "import sys; print(sys.path)"
Reply
#9
Hi thank you for your help.

I will respond in 8 hours thank you
Reply
#10
# Test pip
E:\
λ pip -V
pip 19.1.1 from c:\python37\lib\site-packages\pip (python 3.7)

# Test Python
E:\
λ python -c "import sys; print(sys.executable)
C:\python37\python.exe

# Install
E:\
λ pip install pdf2image
Collecting pdf2image
  Downloading .......
Installing collected packages: pdf2image
Successfully installed pdf2image-1.6.0

# Test that it work
E:\
λ ptpython
>>> import pdf2image

>>> pdf2image.__file__
'c:\\python37\\lib\\site-packages\\pdf2image\\__init__.py'
>>> pdf2image.pdf2image.Image.__version__
'5.3.0'

>>> pdf2image.pdf2image.Image
<module 'PIL.Image' from 'c:\\python37\\lib\\site-packages\\PIL\\Image.py'>
>>> exit()
Now that all work,if use for editor/IDE most setup same interpreter also most point to C:\python37\python.exe.
For you a little longer Path Wink
I am not so fan of the long default path
c:\users\USERNAME\appdata\local\programs\python\python37\python.exe
Python 3.6/3.7 and pip installation under Windows
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 921 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 23,867 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,626 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,478 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,548 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,363 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 1,056 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 9,199 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 1,033 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  ModuleNotFoundError: No module named 'omsdk.sdkproto' donvito7 4 1,884 Oct-20-2022, 02:56 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020