python - 无法在 Arch 上的 python/SimpleCV 中使用 webbrowser.open

标签 python archlinux simplecv

我正在使用 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 from notebook instead. IPython.html.widgets has moved to ipywidgets. "IPython.html.widgets has moved to ipywidgets.", 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/

相关文章:

python - 在 Python 的 DataFrame 中选择具有特定工作日的行

docker - 如何在Arch Linux中启用Docker的 “--squash”功能?

python - 使用 SimpleCV 需要多少 Python 知识?

python - 在SimpleCV中查找另一个图像

python - 将 SVG/PDF 转换为 EMF

python - 如何在不使用临时文件的情况下在python中的tarfile中写入大量数据

linux - 如何从 Pacman/Yaourt 搜索返回包裹列表

c++ - Eclipse不会在断点处停止并将线程状态置于Running : User Request

python - simpleCV 和树莓派 : no module named simplecv

python - 安装Anaconda后如何使用YCM?