我正在使用 SimpleCV 进行一个简单的 CV 项目在 Arch Linux .在单个窗口中通过 repl 显示图像和提要工作正常,但是使用浏览器显示不起作用。
img.show()
有效。
img.show(type="browser")
不起作用。 repl 显示以下消息:
/usr/lib/python2.7/site-packages/IPython/html.py:14: ShimWarning: The
IPython.html
package has been deprecated. You should import fromnotebook
instead.IPython.html.widgets
has moved toipywidgets
. "IPython.html.widgets
has moved toipywidgets
.", ShimWarning)
Stacktrace在 pastebin 上。
奇怪的是,在 Debian 上同样可以正常工作,所以我认为可能涉及版本问题。
任何提示将不胜感激。
最佳答案
我认为您拥有的 ShimWarning 不是问题所在(至少目前是这样)。堆栈跟踪显示 python 图像库 (PIL) 中的异常:Exception: fromstring() 已被删除。请改为调用 frombytes()。
所以我怀疑您关于版本不匹配的说法是正确的。看起来 Arch Linux 在 python-pil 3.1 上而 Debian 稳定版仍在 python-pil 2.6它仍然有 fromstring
方法。
在运行 IPython 之前,您可以通过从命令行运行 pip install pillow==2.6.2
来强制使用 PIL 版本。
关于python - 无法在 Arch 上的 python/SimpleCV 中使用 webbrowser.open,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35107125/