我最近通过 Anaconda 通过conda update spyder. 现在,当我尝试通过 Anaconda Navigator 启动 Spyder 时,程序会自动崩溃并显示以下转储:
Traceback (most recent call last):
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 3718, in main
mainwindow = run_spyder(app, options, args)
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 3559, in run_spyder
main.setup()
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 1010, in setup
from spyder.plugins.ipythonconsole.plugin import IPythonConsole
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/plugins/ipythonconsole/plugin.py", line 52, in
from spyder.plugins.ipythonconsole.widgets import ClientWidget
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/plugins/ipythonconsole/widgets/__init__.py", line 16, in
from .debugging import DebuggingWidget
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/plugins/ipythonconsole/widgets/debugging.py", line 22, in
from IPython.core.inputtransformer2 import TransformerManager
ModuleNotFoundError: No module named 'IPython.core.inputtransformer2'
Run Code Online (Sandbox Code Playgroud)
我找不到任何有类似错误的人。正如有人建议的那样,我更新了 IPython,但它没有解决问题。有任何想法吗?
...因为这些都不适合我,所以我是如何解决它的:
通过以下方式检查您拥有的 IPython 版本conda list
就我而言,我得到的是一个相当旧的版本,5.8.0而不是最新的版本
(在撰写本文时7.19.0......通过检查可用版本conda search ipython)
由于conda update ipython没有提供最新版本,我决定手动运行安装最新版本的命令
(对我来说这是conda install -c conda-forge ipython=7.19.0)
就是这样...
小智 3
我有同样的问题。通过以下命令行升级 IPython 有助于解决这种情况。
sudo conda update IPython -n xxx
Run Code Online (Sandbox Code Playgroud)
其中 xxx 是我尝试运行 Spyder 的环境名称。