简体   繁体   中英

Module Not Found Error for 'pdf2image' in Python Script

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM