Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'importing': 0.05; 'error:': 0.07; 'importerror:': 0.07; 'parser': 0.07; 'runs': 0.10; 'subject:question': 0.10; '"done"': 0.16; "'rb')": 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:192.168.1.4': 0.16; 'subject:install': 0.16; 'url:css': 0.16; 'url:html)': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'example': 0.22; 'import': 0.22; 'print': 0.22; 'header :User-Agent:1': 0.23; 'file.': 0.24; 'skip:" 20': 0.27; 'header :In-Reply-To:1': 0.27; 'code': 0.31; 'object.': 0.31; 'file': 0.32; 'run': 0.32; 'quite': 0.32; 'open': 0.33; 'worked': 0.33; 'url:python': 0.33; '(most': 0.33; 'basic': 0.35; 'problem.': 0.35; 'test': 0.35; 'google': 0.35; "didn't": 0.36; 'url:org': 0.36; 'thank': 0.38; 'jason': 0.38; 'to:addr:python-list': 0.38; 'recent': 0.39; 'pdf': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'how': 0.40; "you're": 0.61; 'here:': 0.62; 'name': 0.63; 'different': 0.65; 'header:Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'commenting': 0.84; 'reply- to:addr:python.org': 0.84; 'usage.': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=d+zMl3TE c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=5FYZ9MsUIQAA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=xdP2GhzmAGQA:10 a=izy21TPNAAAA:8 a=wSa8saciAAAA:8 a=OgBFkFo6eQv1U0xePkYA:9 a=QEXdDO2ut3YA:10 a=93pjT4ddzM4A:10 X-AUTH: mrabarnett:2500 Date: Thu, 19 Dec 2013 21:18:39 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: PDFMiner install question References: <0322a155-42ba-459b-8cac-fded7c12ba60@googlegroups.com> <89e3b06c-90d7-4cc5-8367-03c916a4dfcb@googlegroups.com> <472d91fe-2ddb-4a78-8a44-6b171f436903@googlegroups.com> <5460059c-c805-40e3-bd3c-ac2ca677f0f7@googlegroups.com> In-Reply-To: <5460059c-c805-40e3-bd3c-ac2ca677f0f7@googlegroups.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: python-list@python.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 50 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387487928 news.xs4all.nl 2961 [2001:888:2000:d::a6]:35330 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62417 On 19/12/2013 19:36, Jason Mellone wrote: > MRAB: Thank you your exact solution worked perfectly. > > Now I am trying to run some code from (http://www.unixuser.org/~euske/python/pdfminer/programming.html) under basic usage. > > If I try to run > > from pdfminer.pdfparser import PDFParser > from pdfminer.pdfdocument import PDFDocument > from pdfminer.pdfpage import PDFPage > from pdfminer.pdfpage import PDFTextExtractionNotAllowed > from pdfminer.pdfinterp import PDFResourceManager > from pdfminer.pdfinterp import PDFPageInterpreter > from pdfminer.pdfdevice import PDFDevice > > # Open a PDF file. > fp = open('C:\\USERS\\Python27\\samples\\test.pdf', 'rb') > # Create a PDF parser object associated with the file object. > parser = PDFParser(fp) > # Create a PDF document object that stores the document structure. > document = PDFDocument(parser) > > print "done" > > > > I get the following error: > PS C:\USERS\Python27> .\python.exe .\MyTest.py > Traceback (most recent call last): > File ".\MyTest.py", line 4, in > from pdfminer.pdfpage import PDFTextExtractionNotAllowed > ImportError: cannot import name PDFTextExtractionNotAllowed > > > If I run commenting out the import of "PDFTextExtractionNotAllowed" it runs without a problem. Quite odd. > A quick Google tokk me here: http://css.dzone.com/articles/pdf-reading Its example contains: from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter, PDFTextExtractionNotAllowed Note how it's importing PDFTextExtractionNotAllowed from a different place. Perhaps the author of the code you're looking at didn't test it. It happens! :-)