G. Trialonis
G. Trialonis

Reputation: 99

ModuleNotFoundError: No module named 'PyPDF2'

I have two versions of Python in my computer, 3.6.4 and 3.7. I can import module PyPDF2 in the former but not in the latter, Python 3.7. When I try, I receive the following error:

ModuleNotFoundError: No module named 'PyPDF2'

How can I import PyPDF2 in Python 3.7? I have the same problem with other modules as well.

Upvotes: 0

Views: 5082

Answers (1)

JacobIRR
JacobIRR

Reputation: 8946

For each python version, import sys and print(sys.path).

This will show you where your available import sources are, namely the site-packages directory.

If you think the packages are compatible between your two versions:

Copy the contents of the site-packages directory from the working version into the site-packages directory for the non working version.

If not:

Install the package(s) correctly into the right location, ideally using pip.

Upvotes: 1

Related Questions