Python Forum

Full Version: PDFplumber
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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.
(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.