I am working on a project to extract text from a bunch of scanned PDF's. I am following this tutorial. One of the first steps involves importing modules. I'm having some trouble importing 'pdf2image'. For context, I'm using a Conda environment called, "textExtractor" in VS Code's Python terminal. I checked if pdf2image was installed by running "Conda list" and it looks to be installed. However, when I run the python script I get an error saying,
(textExtractor) C:\Users\mhiebing\Documents\GitHub_Repos\MonthlyStatsExtract>C:/Users/mhiebing/Anaconda3/python.exe c:/Users/mhiebing/Documents/GitHub_Repos/MonthlyStatsExtract/PDF_to_Image.py
Traceback (most recent call last): File "c:/Users/mhiebing/Documents/GitHub_Repos/MonthlyStatsExtract/PDF_to_Image.py", line 1, in from pdf2image import convert_from_path, convert_from_bytes
ModuleNotFoundError: No module named 'pdf2image'
Below is a screenshot showing pdf2image and the error:
Any idea what's going wrong?
The python interpreter you selected is not the textExtractor
but the mhiebing
.
You can click the Status Bar of interpreter to switch the interpreter. And you can refer to the official docs for more details.
It looks like you type the command to run the file, it's not recommended. You can click the green triangle button on the top right corner or the F5
to debug it. If you do that you can find out the truthly environment you are taking.