Issue
I've been using anaconda Spyder for a few weeks for one of my classes and when I anaconda today, Spyder was not listed as installed. So I updated anaconda and restarted my MacBook and Spyder was back. Now, when I try launch Spyder, I get this error:
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!
Ive tried reinstalling Spyder, using a different version of Spyder, but I can't seem to get past this error. If anyone could help id really appreciate it, I need to use this software for my class.
New error:
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!```
Solution
Try resetting spyder
conda activate your_spyder_env
spyder --reset
If that doesn't work try deleting the history lcoated as below and then re-running/reinstalling
user_dir/.config/spyder-py3
If that doesn't work try uninstalling, checking that all the files have been fully removed as below, updating conda, then reinstalling in a new environment
conda activate your_spyder_env
conda remove spyder
Check and make sure below or equivalent has properly removed. Note: Your first and last name appear to be present in the logs, just a headsup in case you want to obscure it from the web
user_dir/opt/anaconda3/lib/python3.9/site-packages/spyder
Reinstall
conda update anaconda
conda create --name new_spyder_env spyder
Answered By - remsky
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.