从SimpleCV导入Shell时的ShimWarning

2 投票
1 回答
1101 浏览
提问于 2025-05-10 10:03

当我从 SimpleCV 导入 Shell 时

from SimpleCV import Shell

我遇到了这个错误

C:\Python27\lib\site-packages\IPython\config.py:13: ShimWarning: IPython.config 这个包已经不推荐使用了。你应该从 traitlets.config 导入。

C:\Python27\lib\site-packages\IPython\frontend.py:21: ShimWarning: 顶层的 frontend 包也已经不推荐使用了。它的所有子包都已经移到顶层的 IPython 里。

虽然我调用了

Shell.main()

SimpleCV 控制台确实启动了,但当我关闭 img.show() 的窗口时,它不仅关闭了 SimpleCV 控制台,还退出了整个 Python 控制台。

我不知道发生了什么!

相关文章:

  • 暂无相关问题
暂无标签

1 个回答

1

有些SimpleCV的代码需要更新,因为我觉得它是为一个比现在安装的版本更旧的版本写的。你需要做的事情如下:

首先,找到 Shell.py 文件,它可能在类似 C:\Python27\Lib\site-packages\SimpleCV\Shell 的地方,然后用编辑器打开它。接下来,按照下面的步骤操作:

在大约第50行,把 from IPython.config.loader import Config 改成 from traitlets.config.loader import Config

在大约第51行,把 from IPython.frontend.terminal.embed import InteractiveShellEmbed 改成 from IPython.terminal.embed import InteractiveShellEmbed

撰写回答