Anaconda启动spyder错误ModuleNotFoundError

问题描述

修订:现在我又遇到了另一个timeit错误

我当时正在使用anaconda发射的spyder进行编码,突然出现了这个错误:timeit中找不到计时器,该计时器已经为我工作了一秒钟。然后,我重新启动了anaconda并重新安装了spyder,但是当我再次尝试启动spyder时,出现了以下错误。有人可以帮忙吗?我正在使用MacOS和最新版本的spyder。

应用程序启动错误:应用程序间谍可能产生了以下错误

Traceback (most recent call last):
File "/Users/___/opt/anaconda3/bin/spyder",line 11,in 
sys.exit(main())
File "/Users/___/opt/anaconda3/lib/python3.8/site-packages/spyder/app/start.py",line 205,in main
mainwindow.main()
File "/Users/___/opt/anaconda3/lib/python3.8/site-packages/spyder/app/mainwindow.py",line 3651,in main
mainwindow = run_spyder(app,options,args)
File "/Users/___/opt/anaconda3/lib/python3.8/site-packages/spyder/app/mainwindow.py",line 3526,in run_spyder
main.setup()
File "/Users/___/opt/anaconda3/lib/python3.8/site-packages/spyder/app/mainwindow.py",line 945,in setup
from spyder.plugins.ipythonconsole.plugin import IPythonConsole
File "/Users/___m/opt/anaconda3/lib/python3.8/site-packages/spyder/plugins/ipythonconsole/plugin.py",line 46,in 
from spyder.plugins.ipythonconsole.widgets import (ClientWidget,File "/Users/___/opt/anaconda3/lib/python3.8/site-packages/spyder/plugins/ipythonconsole/widgets/__init__.py",line 16,in 
from .debugging import DebuggingWidget
File "/Users/___/opt/anaconda3/lib/python3.8/site-packages/spyder/plugins/ipythonconsole/widgets/debugging.py",line 15,in 
from IPython.core.history import HistoryManager
File "/Users/___/opt/anaconda3/lib/python3.8/site-packages/IPython/__init__.py",line 56,in 
from .terminal.embed import embed
File "/Users/___/opt/anaconda3/lib/python3.8/site-packages/IPython/terminal/embed.py",line 17,in 
from IPython.terminal.ipapp import load_default_config
File "/Users/___/opt/anaconda3/lib/python3.8/site-packages/IPython/terminal/ipapp.py",line 28,in 
from IPython.core.magics import (
File "/Users/___/opt/anaconda3/lib/python3.8/site-packages/IPython/core/magics/__init__.py",line 21,in 
from .execution import ExecutionMagics
File "/Users/___/opt/anaconda3/lib/python3.8/site-packages/IPython/core/magics/execution.py",line 148,in 
class Timer(timeit.Timer):
AttributeError: module 'timeit' has no attribute 'Timer'

解决方法

您必须安装NumPy库

conda install numpy