Anaconda - Spyder 不再启动

Anaconda - Spyder no longer launching

我已经为我的 classes 之一使用 anaconda Spyder 几个星期了,当我今天使用 anaconda 时,Spyder 没有被列为已安装。所以我更新了 anaconda 并重新启动了我的 MacBook,Spyder 又回来了。现在,当我尝试启动 Spyder 时,出现此错误:

unittest: No module named 'lxml'
Traceback (most recent call last):
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/find_plugins.py", line 119, in find_external_plugins
mod = importlib.import_module(entry_point.module_name)
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 972, in _find_and_load_unlocked
File "", line 228, in _call_with_frames_removed
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder_unittest/__init__.py", line 9, in 
from .unittestplugin import UnitTestPlugin as PLUGIN_CLASS
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder_unittest/unittestplugin.py", line 21, in 
from spyder_unittest.widgets.unittestgui import UnitTestWidget
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder_unittest/widgets/unittestgui.py", line 26, in 
from spyder_unittest.backend.noserunner import NoseRunner
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder_unittest/backend/noserunner.py", line 9, in 
from lxml import etree
ModuleNotFoundError: No module named 'lxml'
Traceback (most recent call last):
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/utils.py", line 281, in create_window
main.setup()
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py", line 850, in setup
internal_plugins = find_internal_plugins()
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/find_plugins.py", line 92, in find_internal_plugins
mod = importlib.import_module(entry_point.module_name)
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/plugins/findinfiles/plugin.py", line 18, in 
from spyder.plugins.findinfiles.widgets import FindInFilesWidget
ImportError: cannot import name 'FindInFilesWidget' from 'spyder.plugins.findinfiles.widgets' (/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/plugins/findinfiles/widgets/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/aidenwalsh/opt/anaconda3/bin/spyder", line 11, in 
sys.exit(main())
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/start.py", line 237, in main
mainwindow.main(options, args)
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py", line 1992, in main
mainwindow = create_window(MainWindow, app, splash, options, args)
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/utils.py", line 283, in create_window
if main.console is not None:
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py", line 1088, in __getattr__
return self.get_plugin(self._INTERNAL_PLUGINS_MAPPING[attr])
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py", line 165, in get_plugin
raise SpyderAPIError(f'Plugin "{plugin_name}" not found!')
spyder.api.exceptions.SpyderAPIError: Plugin "internal_console" not found!

我试过使用不同版本的 Spyder 重新安装 Spyder,但我似乎无法克服这个错误。如果有人能帮助 id 真的很感激,我需要为我的 class.

使用这个软件

新错误:

main.setup()
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py", line 850, in setup
internal_plugins = find_internal_plugins()
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/find_plugins.py", line 92, in find_internal_plugins
mod = importlib.import_module(entry_point.module_name)
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/plugins/findinfiles/plugin.py", line 18, in 
from spyder.plugins.findinfiles.widgets import FindInFilesWidget
ImportError: cannot import name 'FindInFilesWidget' from 'spyder.plugins.findinfiles.widgets' (/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/plugins/findinfiles/widgets/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/aidenwalsh/opt/anaconda3/bin/spyder", line 11, in 
sys.exit(main())
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/start.py", line 237, in main
mainwindow.main(options, args)
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py", line 1992, in main
mainwindow = create_window(MainWindow, app, splash, options, args)
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/utils.py", line 283, in create_window
if main.console is not None:
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py", line 1088, in __getattr__
return self.get_plugin(self._INTERNAL_PLUGINS_MAPPING[attr])
File "/Users/aidenwalsh/opt/anaconda3/lib/python3.9/site-packages/spyder/app/mainwindow.py", line 165, in get_plugin
raise SpyderAPIError(f'Plugin "{plugin_name}" not found!')
spyder.api.exceptions.SpyderAPIError: Plugin "internal_console" not found!```

我可以观察到一些问题,但第一个问题可以通过安装 LXML 来解决

pip install lxml

尝试从终端安装。 然后和我们一起撕碎结果

尝试重置 spyder

conda activate your_spyder_env

spyder --reset

如果这不起作用,请尝试删除如下所示的历史记录,然后 re-running/reinstalling

user_dir/.config/spyder-py3

如果那个不起作用尝试卸载,检查所有文件是否已完全删除如下,更新conda,然后在新环境中重新安装

conda activate your_spyder_env

conda remove spyder

检查并确保以下内容或等效内容已正确删除。 注意:您的名字和姓氏似乎出现在日志中,只是提醒一下,以防您想在网络上隐藏它

user_dir/opt/anaconda3/lib/python3.9/site-packages/spyder

重新安装

conda update anaconda

conda create --name new_spyder_env spyder