I am following along the book "Automate Boring Stuff with Python", but I receive the an error when trying to run this simple script.
import PyPDF2
pdfFileObj = open('meetingminutes.pdf', 'rb')
pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
The complete error message was:
runfile('D:/Python files/PyPDF2/PyPDF2.py', wdir='D:/Python files/PyPDF2')
Traceback (most recent call last):
File "<ipython-input-4-caab1b8716b0>", line 1, in <module>
runfile('D:/Python files/PyPDF2/PyPDF2.py', wdir='D:/Python files/PyPDF2')
File "C:\Users\cjwu\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)
File "C:\Users\cjwu\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/Python files/PyPDF2/PyPDF2.py", line 22, in <module>
import PyPDF2
File "D:\Python files\PyPDF2\PyPDF2.py", line 25, in <module>
pdfReader = PyPDF2.PdfFileReader(pdfFileObj)
AttributeError: module 'PyPDF2' has no attribute 'PdfFileReader'
Thank you for your help!