anaconda安装后spyder不工作

数据挖掘 Python
2022-03-12 09:46:25

我正在使用 ubuntu 16.04。anacoda 安装后sypder 打不开。蟒蛇版本:4.4.6

蟒蛇环境

my_root                  /home/shiva/.conda/envs/my_root
py27                     /home/shiva/.conda/envs/py27
py35                     /home/shiva/.conda/envs/py35
base                  *  /home/shiva/anaconda
myenv                    /home/shiva/anaconda/envs/myenv

我收到以下错误

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/spyderlib/spyder.py", line 2331, in main
    mainwindow = run_spyder(app, options, args)
  File "/usr/lib/python3/dist-packages/spyderlib/spyder.py", line 2215, in run_spyder
    main.setup()
  File "/usr/lib/python3/dist-packages/spyderlib/spyder.py", line 752, in setup
    from spyderlib.plugins.inspector import ObjectInspector
  File "/usr/lib/python3/dist-packages/spyderlib/plugins/inspector.py", line 41, in <module>
    from spyderlib.widgets.ipython import IPythonControlWidget
  File "/usr/lib/python3/dist-packages/spyderlib/widgets/ipython.py", line 28, in <module>
    pygments_patch.apply()
  File "/usr/lib/python3/dist-packages/spyderlib/pygments_patch.py", line 22, in apply
    from pygments.lexer import _TokenType, Text, Error
  File "/usr/lib/python3/dist-packages/pygments/lexer.py", line 19, in <module>
    from pygments.filters import get_filter_by_name
  File "/usr/lib/python3/dist-packages/pygments/filters/__init__.py", line 20, in <module>
    from pygments.plugin import find_plugin_filters
  File "/usr/lib/python3/dist-packages/pygments/plugin.py", line 39, in <module>
    import pkg_resources
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2952, in _initialize_master_working_set
    add_activation_listener(lambda dist: dist.activate())
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 956, in subscribe
    callback(dist)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2952, in <lambda>
    add_activation_listener(lambda dist: dist.activate())
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2515, in activate
    declare_namespace(pkg)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2097, in declare_namespace
    _handle_ns(packageName, path_item)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2047, in _handle_ns
    _rebuild_mod_path(path, packageName, module)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2066, in _rebuild_mod_path
    orig_path.sort(key=position_in_sys_path)
AttributeError: '_NamespacePath' object has no attribute 'sort'

我怎么解决这个问题?

1个回答

根据此错误报告,您可以通过以下方式解决此问题:

pip install --upgrade pip setuptools