在Anaconda prompt中直接输入spyder,报错如下
Traceback (most recent call last):File "C:\Users\user\.conda\envs\KB\Scripts\spyder-script.py", line 10, in
sys.exit(main())File "C:\Users\user\.conda\envs\KB\lib\site-packages\spyder\app\start.py", line 214, in main
mainwindow.main(options, args)File "C:\Users\user\.conda\envs\KB\lib\site-packages\spyder\app\mainwindow.py", line 2293, in main
mainwindow = create_window(app, splash, options, args)File "C:\Users\user\.conda\envs\KB\lib\site-packages\spyder\app\mainwindow.py", line 2146, in create_window
main.setup()File "C:\Users\user\.conda\envs\KB\lib\site-packages\spyder\app\mainwindow.py", line 882, in setup
plugin_instance = plugin_class(self, configuration=CONF)File "C:\Users\user\.conda\envs\KB\lib\site-packages\spyder\api\plugins.py", line 1425, in __init__
widget.set_icon(self.get_icon())File "C:\Users\user\.conda\envs\KB\lib\site-packages\spyder\plugins\profiler\plugin.py", line 70, in get_icon
return self.create_icon('profiler')File "C:\Users\user\.conda\envs\KB\lib\site-packages\spyder\api\plugins.py", line 1136, in create_icon
return ima.icon(name)File "C:\Users\user\.conda\envs\KB\lib\site-packages\spyder\utils\icon_manager.py", line 380, in icon
return qta.icon(*args, **kwargs)File "C:\Users\user\.conda\envs\KB\lib\site-packages\qtawesome\__init__.py", line 146, in icon
return _instance().icon(*names, **kwargs)File "C:\Users\user\.conda\envs\KB\lib\site-packages\qtawesome\iconic_font.py", line 305, in icon
names[i]))File "C:\Users\user\.conda\envs\KB\lib\site-packages\qtawesome\iconic_font.py", line 353, in _parse_options
prefix, chars = self._get_prefix_chars(names)File "C:\Users\user\.conda\envs\KB\lib\site-packages\qtawesome\iconic_font.py", line 384, in _get_prefix_chars
raise Exception(error)Exception: Invalid icon name "timer-outline" in font "mdi"
尝试了一万个方法,什么重新卸载spyder(uninstall spyder)然后重新安装。以及很多人使用了spyder --reset就可载入了。
1、https://stackoverflow.com/questions/67330450/sypder-5-0-1-fails-to-load
2、https://blog.csdn.net/lad_z/article/details/123202705
3、https://blog.csdn.net/weixin_45870475/article/details/118492394
4、https://www.zhihu.com/question/68785387/answer/3287188573
https://blog.csdn.net/mzm123321/article/details/125336592
这些尝试始终不能解决该问题。对于该问题,只能对症下药,我们能够注意到
File "C:\Users\user\.conda\envs\KB\lib\site-packages\qtawesome\__init__.py", line 146, in icon
return _instance().icon(*names, **kwargs)File "C:\Users\user\.conda\envs\KB\lib\site-packages\qtawesome\iconic_font.py", line 305, in icon
names[i]))File "C:\Users\user\.conda\envs\KB\lib\site-packages\qtawesome\iconic_font.py", line 353, in _parse_options
prefix, chars = self._get_prefix_chars(names)File "C:\Users\user\.conda\envs\KB\lib\site-packages\qtawesome\iconic_font.py", line 384, in _get_prefix_chars
raise Exception(error)Exception: Invalid icon name "timer-outline" in font "mdi"
猜测应该是这个包qtawesome出现了问题,通过将该问题复制到外网,在stackoverflow确实发现了相同的报错问题。
See https://stackoverflow.com/questions/67114637/why-spyder-5-0-0-application-launch-error-when-launching-from-user-defined-envir.
直接使用命令
conda install qtawesome=1.0.2
重新安装qtawesome该库即可进入spyder了。