Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PDFplumber
#1
Hi,

I wrote a script to extract text from a pdf file using pdfplumber and pdfminer as I wanted to try both. For months the script ran fine but suddenly it started giving me the error below. When I do help("modules") in Python3 they appear on the list of available modules.

Should I reinstall Python3?

Output:
Traceback (most recent call last): File "c:/Users/Me/Desktop/Python 3/Python project/Final pdfplumber.py", line 11, in <module> import pdfplumber File "C:\Python3.8\lib\site-packages\pdfplumber\__init__.py", line 1, in <module> from .pdf import PDF File "C:\Python3.8\lib\site-packages\pdfplumber\pdf.py", line 1, in <module> from .container import Container File "C:\Python3.8\lib\site-packages\pdfplumber\container.py", line 2, in <module> from . import utils File "C:\Python3.8\lib\site-packages\pdfplumber\utils.py", line 1, in <module> from pdfminer.utils import PDFDocEncoding File "c:\Users\Me\Desktop\Python 3\Python project\pdfminer.py", line 6, in <module> from pdfminer.high_level import extract_text ModuleNotFoundError: No module named 'pdfminer.high_level'; 'pdfminer' is not a package
Reply
#2
If you have a file named "pdfminer.py", that can interfere with the operation of a module that also uses the name "pdfminer".

Try renaming your file to something else so it doesn't conflict and try again.
nilamo and pprod like this post
Reply
#3
(Jan-26-2021, 06:01 PM)bowlofred Wrote: If you have a file named "pdfminer.py", that can interfere with the operation of a module that also uses the name "pdfminer".

Try renaming your file to something else so it doesn't conflict and try again.

That solved the problem! Thanks so much bowlofred.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Extracting Data into Columns using pdfplumber arvin 17 5,596 Dec-17-2022, 11:59 AM
Last Post: arvin
  pdfminer vs pdfplumber pprod 2 6,160 Jan-30-2021, 01:35 PM
Last Post: pprod
  PDFplumber pprod 2 2,388 Nov-10-2020, 02:37 PM
Last Post: pprod
  PDFplumber pprod 2 2,079 Nov-06-2020, 08:34 AM
Last Post: pprod

Forum Jump:

User Panel Messages

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