Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ModuleNotFoundError: No module named 'pdfminer.high_level'

I work on project in pycharm , i'd like to use pdfminer in order to convert a pdf file to a text file. My problem is when i run the app i't doesn't work and it display this error message : ModuleNotFoundError: No module named 'pdfminer.high_level'

import re
from pdfminer.high_level import extract_pages, extract_text

text = extract_text("_DarkWeb_1642453520.pdf")
print(text)

the full error message:

 /home/oran/PycharmProjects/pythonProject/venv/bin/python /home/oran/PycharmProjects/pythonProject/main.py 
Traceback (most recent call last):
  File "/home/oran/PycharmProjects/pythonProject/main.py", line 2, in <module>
    from pdfminer.high_level import extract_pages, extract_text
ModuleNotFoundError: No module named 'pdfminer.high_level'


python version 3.10.4

like image 765
oran ben david Avatar asked Sep 09 '25 18:09

oran ben david


1 Answers

I suppose that you installed only pdfminer which is not maintained anymore.

To import the module pdfminer.high_level, you should go for pdfminer.six instead by first running this command from your terminal :

pip install pdfminer.six

If you use a virtual environement, use the dash instead of the dot.

pip install pdfminer-six
like image 150
Timeless Avatar answered Sep 12 '25 06:09

Timeless