Spyder 未从 Anaconda 环境之一启动

Posted

技术标签:

【中文标题】Spyder 未从 Anaconda 环境之一启动【英文标题】:Spyder not launching from one of the Anaconda environments 【发布时间】:2020-08-16 21:09:01 【问题描述】:

我是新手。我已经开始使用 Python 学习 OpenCV,并按照课程说明成功创建了一个 Anaconda 环境,我可以从中轻松导入 CV2 并执行我的课程。到目前为止,我在使用这种环境时没有遇到任何问题。

现在,我想开始使用 Spyder,它可以从默认/基本环境很好地启动,但不能从我创建的“opencv-course”环境启动。相比之下,Jupyter Labs 和 Notebooks 在这两种环境中都能很好地启动。

我尝试在启动 Anaconda 时使用管理员权限卸载/重新安装 Spyder,但无济于事。

有人可以提出建议吗?

非常感谢! 医学博士

显示以下错误信息:

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\opencv-course\Scripts\spyder-script.py", line 10, in 
sys.exit(main())
File "C:\ProgramData\Anaconda3\envs\opencv-course\lib\site-packages\spyder\app\start.py", line 205, in main
mainwindow.main()
File "C:\ProgramData\Anaconda3\envs\opencv-course\lib\site-packages\spyder\app\mainwindow.py", line 3734, in main
mainwindow = run_spyder(app, options, args)
File "C:\ProgramData\Anaconda3\envs\opencv-course\lib\site-packages\spyder\app\mainwindow.py", line 3590, in run_spyder
main.setup()
File "C:\ProgramData\Anaconda3\envs\opencv-course\lib\site-packages\spyder\app\mainwindow.py", line 977, in setup
'spyder.plugins.'.format(plugin_name))
File "C:\ProgramData\Anaconda3\envs\opencv-course\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "C:\ProgramData\Anaconda3\envs\opencv-course\lib\site-packages\spyder\plugins\pylint\__init__.py", line 14, in 
from .plugin import Pylint as PLUGIN_CLASS
File "C:\ProgramData\Anaconda3\envs\opencv-course\lib\site-packages\spyder\plugins\pylint\plugin.py", line 29, in 
from spyder.plugins.pylint.confpage import PylintConfigPage
File "C:\ProgramData\Anaconda3\envs\opencv-course\lib\site-packages\spyder\plugins\pylint\confpage.py", line 16, in 
from spyder.plugins.pylint.widgets.pylintgui import PylintWidget
File "C:\ProgramData\Anaconda3\envs\opencv-course\lib\site-packages\spyder\plugins\pylint\widgets\pylintgui.py", line 37, in 
from spyder.plugins.pylint.utils import get_pylintrc_path
File "C:\ProgramData\Anaconda3\envs\opencv-course\lib\site-packages\spyder\plugins\pylint\utils.py", line 16, in 
import pylint.config
File "C:\ProgramData\Anaconda3\envs\opencv-course\lib\site-packages\pylint\config.py", line 54, in 
import toml
ModuleNotFoundError: No module named 'toml'

【问题讨论】:

【参考方案1】:

在此处查看此答案后: Spyder failed to launch in Anaconda after update (4.1.2)

我通过将 Pylint 的版本从 2.5 降级到 2.4.4 解决了这个问题。现在可以正常使用了。

非常感谢! 医学博士

【讨论】:

以上是关于Spyder 未从 Anaconda 环境之一启动的主要内容,如果未能解决你的问题,请参考以下文章

fbprophet/Prophet 拟合函数中止并重新启动 Anaconda/Spyder Python 内核

如何在多版本anaconda python环境下转换spyder

由于绝地问题,Anaconda Spyder无法启动

Anaconda安装+Spyder Tensorflow环境配置

在所有 Anaconda 环境中,Spyder 在加载期间不断崩溃

anaconda 中spyder打开