After anaconda installation spyder not working I am using ubuntu 16.04.
after anacoda installation sypder not open.
Anaconda version: 4.4.6

Anaconda environment

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


I get the following error

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 &lt;module&gt;
    from spyderlib.widgets.ipython import IPythonControlWidget
  File "/usr/lib/python3/dist-packages/spyderlib/widgets/ipython.py", line 28, in &lt;module&gt;
    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 &lt;module&gt;
    from pygments.filters import get_filter_by_name
  File "/usr/lib/python3/dist-packages/pygments/filters/__init__.py", line 20, in &lt;module&gt;
    from pygments.plugin import find_plugin_filters
  File "/usr/lib/python3/dist-packages/pygments/plugin.py", line 39, in &lt;module&gt;
    import pkg_resources
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2927, in &lt;module&gt;
    @_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 &lt;lambda&gt;
    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'


how can I solve this problem?
According to this bug report, you can solve this with:

pip install --upgrade pip setuptools