阅读pdf的问题。在Windows7上使用带有anaconda的魔杖的文件

时间:2017-11-20 21:14:02

标签: python windows pdf anaconda wand

我安装了ImageMagick-6.9.9-Q8,将路径设置为"C:\Program Files\ImageMagick-6.9.9-Q8",并希望运行以下代码:

from wand.image import Image as wi
import io
pdf = wi(filename = "sample2.pdf", resolution = 300)

在这里我立刻得到了这个错误:

---------------------------------------------------------------------------
DelegateError                             Traceback (most recent call last)
<ipython-input-6-3e32bc349c64> in <module>()
      4 
      5 # reading the pdf file
----> 6 pdf = wi(filename = "sample2.pdf", resolution = 300)
      7 # and converting it to jpeg
      8 pdfImage = pdf.convert('jpeg')

~\Anaconda3\lib\site-packages\wand\image.py in __init__(self, image, blob, file, filename, format, width, height, depth, background, resolution)
   2742                     self.read(blob=blob, resolution=resolution)
   2743                 elif filename is not None:
-> 2744                     self.read(filename=filename, resolution=resolution)
   2745                 # clear the wand format, otherwise any subsequent call to
   2746                 # MagickGetImageBlob will silently change the image to this

~\Anaconda3\lib\site-packages\wand\image.py in read(self, file, filename, blob, resolution)
   2820             r = library.MagickReadImage(self.wand, filename)
   2821         if not r:
-> 2822             self.raise_exception()
   2823 
   2824     def close(self):

~\Anaconda3\lib\site-packages\wand\resource.py in raise_exception(self, stacklevel)
    220             warnings.warn(e, stacklevel=stacklevel + 1)
    221         elif isinstance(e, Exception):
--> 222             raise e
    223 
    224     def __enter__(self):

DelegateError: PDFDelegateFailed `The system cannot find the file specified.
' @ error/pdf.c/ReadPDFImage/809

一般来说,我对Anaconda lateley有很多问题,因为几乎不可能安装任何软件包。希望有人可以帮我解决这个问题。

谢谢!

0 个答案:

没有答案