差异在PyCharm和终端中运行python

时间:2014-12-15 12:45:29

标签: python-2.7 pdf imagemagick pycharm wand

我想知道从PyCharm或命令行运行python程序时有什么区别。

实际上我正在使用一个名为wand-py的图书馆(ImageMagick绑定)。

如果我从命令行运行我的程序就可以了。

虽然如果我使用PyCharm Run或调试它没有,我得到以下回溯。

/Users/alexisbenoist/Documents/python/papyrus/env/bin/python "/Applications/PyCharm CE.app/helpers/pydev/pydevd.py" --multiproc --client 127.0.0.1 --port 58993 --file /Users/alexisbenoist/Documents/python/papyrus/tets.py
Connected to pydev debugger (build 135.973)
pydev debugger: process 73166 is connecting

Traceback (most recent call last):
  File "/Applications/PyCharm CE.app/helpers/pydev/pydevd.py", line 1733, in <module>
    debugger.run(setup['file'], None, None)
  File "/Applications/PyCharm CE.app/helpers/pydev/pydevd.py", line 1226, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/Users/alexisbenoist/Documents/python/papyrus/tets.py", line 23, in <module>
    blob = image_to_blob(PATH)
  File "/Users/alexisbenoist/Documents/python/papyrus/tets.py", line 12, in image_to_blob
    pdf.alpha_channel = False
  File "/Users/alexisbenoist/Documents/python/papyrus/env/lib/python2.7/site-packages/wand/image.py", line 419, in wrapped
    result = function(self, *args, **kwargs)
  File "/Users/alexisbenoist/Documents/python/papyrus/env/lib/python2.7/site-packages/wand/image.py", line 992, in alpha_channel
    self.raise_exception()
  File "/Users/alexisbenoist/Documents/python/papyrus/env/lib/python2.7/site-packages/wand/resource.py", line 218, in raise_exception
    raise e
wand.exceptions.WandError: wand contains no images `MagickWand-1' @ error/magick-image.c/MagickSetImageAlphaChannel/9504

我在终端和PyCharm中使用相同的虚拟环境。

你们知道可能导致问题的原因吗?

谢谢,

亚历。

0 个答案:

没有答案