Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"no module named PyPDF2" error

Tags:

I use Spyder, with Python 2.7, on a windows 10. I was able to install the PyPDF2 package with a conda command from my prompt. I said installation complete. Yet, If I try to run a simple import command:

import PyPDF2

I get the error:

ImportError: No module named PyPDF2

How can I fix this?

like image 692
ALisboa Avatar asked Aug 31 '16 05:08

ALisboa


People also ask

How do I install PyPDF2 module using Windows?

type cmd. excute the command line (black window) type cd C:\Users\User\Downloads\pyPDF2 to go into the directory where the setup.py is (this is mine if I downloaded it) The path can be copied from the explorer window. type dir now you should see the name setup.py in the listing of all contents.

Does PyPDF2 work with Python 3?

Use PyPDF2. I've been using it in Python 3 (v3. 5.2 to be precise), and it works quite well. Here's a simple command that you can use to install PyPDF2.

What is PyPDF2 package?

PyPDF2 is a pure Python PDF library capable of: extracting document information (title, author, …) splitting documents page by page. merging documents page by page. cropping pages.


2 Answers

In my case, I was trying to import 'pyPdf2' instead of 'PyPDF2'. Observe the case.

import PyPDF2

is correct.

like image 115
Ashutosh Chamoli Avatar answered Oct 09 '22 15:10

Ashutosh Chamoli


If you use python3 maybe

apt-get install python3-pypdf2 
like image 20
Junior Usca Avatar answered Oct 09 '22 14:10

Junior Usca