timClicks / slate

The simplest way to extract text from PDFs in Python
http://timmcnamara.co.nz/
GNU General Public License v3.0
428 stars 139 forks source link

AttributeError: module 'slate' has no attribute 'PDF' #42

Open Wesalius opened 6 years ago

Wesalius commented 6 years ago
filename = "file.pdf"
import slate
with open('file.pdf') as f:
    doc = slate.PDF(f)
    print(doc)

gives

Traceback (most recent call last):
  File "C:\Users\.....\Desktop\interna\slate\slate.py", line 2, in <module>
    import slate
  File "C:\Users\.....\Desktop\interna\slate\slate.py", line 4, in <module>
    doc = slate.PDF(f)
AttributeError: module 'slate' has no attribute 'PDF'

running Python 3.6.4, installed the latest slate downloaded from github today

jangdan commented 6 years ago

A possible solution for many problems; this worked for me a few months ago, with Python 3.6.4: https://github.com/timClicks/slate/pull/32#issuecomment-365474036