title: Error: cannot import name 'PDFDocument' from 'pdfminer.pdfparser'
body: <p>I need to extract text from pdf-files and have used pdfminer.six with success, extracting both text paragraphs and tables. But now I get an error related to the line </p>
  
  <pre><code>from pdfminer.pdfparser import PDFParser, PDFDocument: 
  </code></pre>
  
  <p>ImportError: cannot import name 'PDFDocument' from 'pdfminer.pdfparser' (C:\Users[username]\Anaconda3\lib\site-packages\pdfminer\pdfparser.py)</p>
  
  <p>I'm using Anaconda Jupyter. Python 3.7.3. Package pdfminer.six-20181108</p>
  
  <p>The code I'm using is based on this:
  <a href="https://stackoverflow.com/questions/44024697/how-to-read-pdf-file-using-pdfminer3k">How to read pdf file using pdfminer3k?</a></p>
  
  <p>Based on advice given below I've tried to uninstall and reinstall Anaconda and pdfminer.six and other packages several times: 
  <a href="https://github.com/pdfminer/pdfminer.six/issues/196" rel="noreferrer">https://github.com/pdfminer/pdfminer.six/issues/196</a>
  A week ago it suddenly worked, but now I get an error again. </p>
  
  <p>Since I'm working on Win10 I also tried using Linux Ubuntu as described here:
  <a href="https://medium.com/hugo-ferreiras-blog/using-windows-subsystem-for-linux-for-data-science-9a8e68d7610c" rel="noreferrer">https://medium.com/hugo-ferreiras-blog/using-windows-subsystem-for-linux-for-data-science-9a8e68d7610c</a></p>
  
  <p>Same error. </p>
  
  <p>Then, based on the webpage below I thought it was worth a try to split PDFparser, PDFDocument:
  from</p>
  
  <pre><code>from pdfminer.pdfparser import PDFParser, PDFDocument
  </code></pre>
  
  <p>to</p>
  
  <pre><code>from pdfminer.pdfparser import PDFParser
  from pdfminer.pdfdocument import PDFDocument
  from pdfminer.pdfpage import PDFPage
  </code></pre>
  
  <p><a href="https://loctv.wordpress.com/2017/02/07/fix-importerror-cannot-import-name-pdfdocument-when-using-slate/" rel="noreferrer">https://loctv.wordpress.com/2017/02/07/fix-importerror-cannot-import-name-pdfdocument-when-using-slate/</a>
  ..
  But that created new errors later on in the code. </p>
  
  <p>The start of my code looks like this:</p>
  
  <pre><code>```
  path = [name and path of file]
  fp = open(path, 'rb')
  from pdfminer.pdfparser import PDFParser, PDFDocument
  from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
  from pdfminer.converter import PDFPageAggregator
  from pdfminer.layout import LAParams, LTTextBox, LTTextLine
  ```
  </code></pre>
  
  <p>I expect to be able to run the code and extract the text from the pdf-file, but the code is stopped by the error relating to PDFDocument pdfminer.pdfparser</p>
  
  <p>Any advice on what I should do is much appreciated! Might it has something to do with how pdfminer.six is installed?</p>