Can't access Preferences in spyder #2984

Closed
jazzeps opened this Issue Feb 13, 2016 · 28 comments

Projects

None yet
@jazzeps
jazzeps commented Feb 13, 2016

Description

Just installed Anaconda and opened Spyder(Python 3.5) on my Mac running OS X 10.10.5. When I go to the python menu and select Preferences, I get the following error that shows up in the internal console:

 >>> /Users/davidepstein/anaconda/lib/python3.5/site-packages/nbformat/current.py:19: UserWarning: nbformat.current is deprecated.

- use nbformat for read/write/validate public API
- use nbformat.vX directly to composing notebooks of a particular version

  """)
Traceback (most recent call last):
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/spyder.py", line 2008, in edit_preferences
    widget = plugin.create_configwidget(dlg)
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/plugins/__init__.py", line 212, in create_configwidget
    configwidget.initialize()
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/plugins/configdialog.py", line 59, in initialize
    self.setup_page()
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/plugins/inspector.py", line 136, in setup_page
    jedi_installed = programs.is_module_installed('jedi', '>=0.8.1')
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 292, in is_module_installed
    actver = get_module_version(module_name)
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 238, in get_module_version
    mod = __import__(module_name)
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/api/__init__.py", line 16, in <module>
    from jedi.parser import Parser, load_grammar
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/parser/__init__.py", line 21, in <module>
    from jedi.parser import tree as pt
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/parser/tree.py", line 39, in <module>
    from jedi import cache
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/cache.py", line 32, in <module>
    from jedi import debug
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/debug.py", line 17, in <module>
    init()
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 37, in init
    wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 76, in wrap_stream
    convert=convert, strip=strip, autoreset=autoreset)
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/colorama/ansitowin32.py", line 67, in __init__
    strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
AttributeError: 'SysOutput' object has no attribute 'closed'
Traceback (most recent call last):
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/spyder.py", line 2008, in edit_preferences
    widget = plugin.create_configwidget(dlg)
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/plugins/__init__.py", line 212, in create_configwidget
    configwidget.initialize()
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/plugins/configdialog.py", line 59, in initialize
    self.setup_page()
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/plugins/inspector.py", line 136, in setup_page
    jedi_installed = programs.is_module_installed('jedi', '>=0.8.1')
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 292, in is_module_installed
    actver = get_module_version(module_name)
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 238, in get_module_version
    mod = __import__(module_name)
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/api/__init__.py", line 16, in <module>
    from jedi.parser import Parser, load_grammar
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/parser/__init__.py", line 21, in <module>
    from jedi.parser import tree as pt
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/parser/tree.py", line 39, in <module>
    from jedi import cache
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/cache.py", line 32, in <module>
    from jedi import debug
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/jedi/debug.py", line 17, in <module>
    init()
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 37, in init
    wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 76, in wrap_stream
    convert=convert, strip=strip, autoreset=autoreset)
  File "/Users/davidepstein/anaconda/lib/python3.5/site-packages/colorama/ansitowin32.py", line 67, in __init__
    strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
AttributeError: 'SysOutput' object has no attribute 'closed'

Version and main components

  • Spyder Version: 2.3.8
  • Python Version: 3.5.1
  • Qt Versions: 4.8.7, PyQt4 (API v2) 4.11.4 on Darwin

Optional dependencies

pyflakes >=0.6.0:  1.0.0 (OK)
pep8 >=0.6      :  1.7.0 (OK)
pygments >=1.6  :  2.1 (OK)
IPython >=1.0   :  4.0.3 (OK)
zmq >=2.1.11    :  15.2.0 (OK)
qtconsole >=4.0 :  4.1.1 (OK)
pandas >=0.13.1 :  0.17.1 (OK)
sphinx >=0.6.6  :  1.3.5 (OK)
psutil >=0.3    :  3.4.2 (OK)
rope >=0.9.2    :  0.9.4-1 (OK)
matplotlib >=1.0:  1.5.1 (OK)
sympy >=0.7.3   :  0.7.6.1 (OK)
pylint >=0.25   :  None (NOK)
@psemenik

I'm also using Mac OSX 10.10.5, Spyder 2.3.8, Python 3.5.1 64bits, Qt 4.8.7, PyQt4 (API v2) 4.11.4 on Darwin.
When selecting Preferences I get:

Spyder Internal Console

This console is used to report application
internal errors and to inspect Spyder
internals with the following commands:
  spy.app, spy.window, dir(spy)

Please don't use it to run your code

>>> /Users/username/anaconda/lib/python3.5/site-packages/nbformat/current.py:19: UserWarning: nbformat.current is deprecated.

- use nbformat for read/write/validate public API
- use nbformat.vX directly to composing notebooks of a particular version

  """)
Traceback (most recent call last):
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/spyder.py", line 2008, in edit_preferences
    widget = plugin.create_configwidget(dlg)
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/__init__.py", line 212, in create_configwidget
    configwidget.initialize()
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/configdialog.py", line 59, in initialize
    self.setup_page()
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/inspector.py", line 136, in setup_page
    jedi_installed = programs.is_module_installed('jedi', '>=0.8.1')
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 292, in is_module_installed
    actver = get_module_version(module_name)
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 238, in get_module_version
    mod = __import__(module_name)
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/api/__init__.py", line 16, in <module>
    from jedi.parser import Parser, load_grammar
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/parser/__init__.py", line 21, in <module>
    from jedi.parser import tree as pt
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/parser/tree.py", line 39, in <module>
    from jedi import cache
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/cache.py", line 32, in <module>
    from jedi import debug
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/debug.py", line 17, in <module>
    init()
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 37, in init
    wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 76, in wrap_stream
    convert=convert, strip=strip, autoreset=autoreset)
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/ansitowin32.py", line 67, in __init__
    strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
AttributeError: 'SysOutput' object has no attribute 'closed'
Traceback (most recent call last):
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/spyder.py", line 2008, in edit_preferences
    widget = plugin.create_configwidget(dlg)
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/__init__.py", line 212, in create_configwidget
    configwidget.initialize()
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/configdialog.py", line 59, in initialize
    self.setup_page()
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/inspector.py", line 136, in setup_page
    jedi_installed = programs.is_module_installed('jedi', '>=0.8.1')
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 292, in is_module_installed
    actver = get_module_version(module_name)
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 238, in get_module_version
    mod = __import__(module_name)
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/api/__init__.py", line 16, in <module>
    from jedi.parser import Parser, load_grammar
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/parser/__init__.py", line 21, in <module>
    from jedi.parser import tree as pt
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/parser/tree.py", line 39, in <module>
    from jedi import cache
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/cache.py", line 32, in <module>
    from jedi import debug
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/debug.py", line 17, in <module>
    init()
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 37, in init
    wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 76, in wrap_stream
    convert=convert, strip=strip, autoreset=autoreset)
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/ansitowin32.py", line 67, in __init__
    strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
AttributeError: 'SysOutput' object has no attribute 'closed'
Traceback (most recent call last):
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/spyder.py", line 2008, in edit_preferences
    widget = plugin.create_configwidget(dlg)
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/__init__.py", line 212, in create_configwidget
    configwidget.initialize()
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/configdialog.py", line 59, in initialize
    self.setup_page()
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/inspector.py", line 136, in setup_page
    jedi_installed = programs.is_module_installed('jedi', '>=0.8.1')
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 292, in is_module_installed
    actver = get_module_version(module_name)
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 238, in get_module_version
    mod = __import__(module_name)
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/api/__init__.py", line 16, in <module>
    from jedi.parser import Parser, load_grammar
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/parser/__init__.py", line 21, in <module>
    from jedi.parser import tree as pt
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/parser/tree.py", line 39, in <module>
    from jedi import cache
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/cache.py", line 32, in <module>
    from jedi import debug
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/debug.py", line 17, in <module>
    init()
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 37, in init
    wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 76, in wrap_stream
    convert=convert, strip=strip, autoreset=autoreset)
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/ansitowin32.py", line 67, in __init__
    strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
AttributeError: 'SysOutput' object has no attribute 'closed'
Traceback (most recent call last):
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/spyder.py", line 2008, in edit_preferences
    widget = plugin.create_configwidget(dlg)
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/__init__.py", line 212, in create_configwidget
    configwidget.initialize()
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/configdialog.py", line 59, in initialize
    self.setup_page()
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/plugins/inspector.py", line 136, in setup_page
    jedi_installed = programs.is_module_installed('jedi', '>=0.8.1')
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 292, in is_module_installed
    actver = get_module_version(module_name)
  File "/Users/username/anaconda/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 238, in get_module_version
    mod = __import__(module_name)
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/api/__init__.py", line 16, in <module>
    from jedi.parser import Parser, load_grammar
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/parser/__init__.py", line 21, in <module>
    from jedi.parser import tree as pt
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/parser/tree.py", line 39, in <module>
    from jedi import cache
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/cache.py", line 32, in <module>
    from jedi import debug
  File "/Users/username/anaconda/lib/python3.5/site-packages/jedi/debug.py", line 17, in <module>
    init()
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 37, in init
    wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/initialise.py", line 76, in wrap_stream
    convert=convert, strip=strip, autoreset=autoreset)
  File "/Users/username/anaconda/lib/python3.5/site-packages/colorama/ansitowin32.py", line 67, in __init__
    strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
AttributeError: 'SysOutput' object has no attribute 'closed'
@tenberg
tenberg commented Feb 16, 2016

Happening to me also!!! I'd paste the log file, but it looks very similar to what's already here.

@duchesnay

Just installed Anaconda3-2.5.0-Linux-x86_64.sh shipped with Spyder 2.3.8 on Ubuntu14.04. When selecting Preferences I get:

Spyder Internal Console

This console is used to report application
internal errors and to inspect Spyder
internals with the following commands:
  spy.app, spy.window, dir(spy)

Please don't use it to run your code

>>> /usr/local/anaconda3/lib/python3.5/site-packages/nbformat/current.py:19: UserWarning: nbformat.current is deprecated.

- use nbformat for read/write/validate public API
- use nbformat.vX directly to composing notebooks of a particular version

  """)
Traceback (most recent call last):
  File "/usr/local/anaconda3/lib/python3.5/site-packages/spyderlib/spyder.py", line 2008, in edit_preferences
    widget = plugin.create_configwidget(dlg)
  File "/usr/local/anaconda3/lib/python3.5/site-packages/spyderlib/plugins/__init__.py", line 212, in create_configwidget
    configwidget.initialize()
  File "/usr/local/anaconda3/lib/python3.5/site-packages/spyderlib/plugins/configdialog.py", line 59, in initialize
    self.setup_page()
  File "/usr/local/anaconda3/lib/python3.5/site-packages/spyderlib/plugins/inspector.py", line 136, in setup_page
    jedi_installed = programs.is_module_installed('jedi', '>=0.8.1')
  File "/usr/local/anaconda3/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 292, in is_module_installed
    actver = get_module_version(module_name)
  File "/usr/local/anaconda3/lib/python3.5/site-packages/spyderlib/utils/programs.py", line 238, in get_module_version
    mod = __import__(module_name)
  File "/usr/local/anaconda3/lib/python3.5/site-packages/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/usr/local/anaconda3/lib/python3.5/site-packages/jedi/api/__init__.py", line 16, in <module>
    from jedi.parser import Parser, load_grammar
  File "/usr/local/anaconda3/lib/python3.5/site-packages/jedi/parser/__init__.py", line 21, in <module>
    from jedi.parser import tree as pt
  File "/usr/local/anaconda3/lib/python3.5/site-packages/jedi/parser/tree.py", line 39, in <module>
    from jedi import cache
  File "/usr/local/anaconda3/lib/python3.5/site-packages/jedi/cache.py", line 32, in <module>
    from jedi import debug
  File "/usr/local/anaconda3/lib/python3.5/site-packages/jedi/debug.py", line 17, in <module>
    init()
  File "/usr/local/anaconda3/lib/python3.5/site-packages/colorama/initialise.py", line 37, in init
    wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
  File "/usr/local/anaconda3/lib/python3.5/site-packages/colorama/initialise.py", line 76, in wrap_stream
    convert=convert, strip=strip, autoreset=autoreset)
  File "/usr/local/anaconda3/lib/python3.5/site-packages/colorama/ansitowin32.py", line 67, in __init__
    strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
AttributeError: 'SysOutput' object has no attribute 'closed'


@Dixit22
Dixit22 commented Feb 18, 2016

Just installed Anaconda3-2.5.0-MacOSX-x86_64.pkg on rMBP under OSX 10.11.3 (15D21)

Python 3.5.1 |Anaconda 2.5.0 (x86_64)| (default, Dec  7 2015, 11:24:55) 
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin

which includes Spyder 2.3.8.

When I go (via Launcher.app) to spyder-app and then select Preferences from the python menu, I get substantially the same result as the above. No point in including yet another log file.

Just pleased now to have found I'm not the only one :-)

@malfatti

I have a completely different setup, but I'm getting a very similar error log. The main difference is that I cannot even open spyder (python3)! Spyder (python2) is working perfectly fine.

$ spyder3
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 753, in setup
    self.inspector = ObjectInspector(self)
  File "/usr/lib/python3/dist-packages/spyderlib/plugins/inspector.py", line 407, in __init__
    not programs.is_module_installed('jedi', '>=0.8.1')):
  File "/usr/lib/python3/dist-packages/spyderlib/utils/programs.py", line 292, in is_module_installed
    actver = get_module_version(module_name)
  File "/usr/lib/python3/dist-packages/spyderlib/utils/programs.py", line 238, in get_module_version
    mod = __import__(module_name)
  File "/usr/lib/python3/dist-packages/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/usr/lib/python3/dist-packages/jedi/api/__init__.py", line 16, in <module>
    from jedi.parser import Parser, load_grammar
  File "/usr/lib/python3/dist-packages/jedi/parser/__init__.py", line 21, in <module>
    from jedi.parser import tree as pt
  File "/usr/lib/python3/dist-packages/jedi/parser/tree.py", line 39, in <module>
    from jedi import cache
  File "/usr/lib/python3/dist-packages/jedi/cache.py", line 32, in <module>
    from jedi import debug
  File "/usr/lib/python3/dist-packages/jedi/debug.py", line 17, in <module>
    init()
  File "/usr/lib/python3/dist-packages/colorama/initialise.py", line 37, in init
    wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
  File "/usr/lib/python3/dist-packages/colorama/initialise.py", line 76, in wrap_stream
    convert=convert, strip=strip, autoreset=autoreset)
  File "/usr/lib/python3/dist-packages/colorama/ansitowin32.py", line 67, in __init__
    strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
AttributeError: 'SysOutput' object has no attribute 'closed'

Box:

$ uname -a
Linux LabInVivo Debian-3.14.17-xenomai-2.6.4 #1 SMP Tue Aug 4 14:13:46 BRT 2015 x86_64 GNU/Linux

Python:

$ dpkg -l python3.* | grep ii
ii  python3.4         3.4.4-2      amd64        Interactive high-level object-oriented language (version 3.4)
ii  python3.4-dev     3.4.4-2      amd64        Header files and a static library for Python (v3.4)
ii  python3.4-minimal 3.4.4-2      amd64        Minimal subset of the Python language (version 3.4)
ii  python3.5         3.5.1-5      amd64        Interactive high-level object-oriented language (version 3.5)
ii  python3.5-dev     3.5.1-5      amd64        Header files and a static library for Python (v3.5)
ii  python3.5-minimal 3.5.1-5      amd64        Minimal subset of the Python language (version 3.5

Python packages involved in the error log:

$ dpkg -l python3-{colorama,jedi,spyderlib}
...
ii  python3-colorama       0.3.6-1          all              Cross-platform colored terminal text in Python - 
ii  python3-jedi           0.9.0-1          all              autocompletion tool for Python 3
ii  python3-spyderlib      2.3.8+dfsg1-1    all              Python IDE for scientists (Python 3 modules)
@jitseniesen
Member

This seems to be the same issue as tartley/colorama#85 which is fixed by tartley/colorama@1244a00. As suggested in the discussion at davidhalter/jedi-vim#522, downgrading colorama to a version before 0.3.6 also resolves the problem (I checked and it did for me).

@AlJohri
AlJohri commented Feb 18, 2016

Just wanted to ditto the above, I was having this issue and it was resolved by running pip install colorama==0.3.5

@ccordoba12
Member

@jitseniesen, thanks a lot for the reference! I'll try to patch colorama in Anaconda to solve this problem until a new release of colorama is released.

@Dixit22
Dixit22 commented Feb 18, 2016

For me the issue appears fixed by running

conda install colorama=0.3.3

Thank you.

@psemenik

conda install colorama=0.3.3 fixed this for me as well. Thank you!

@malfatti

In debian, running sudo apt-get install python3-colorama=0.3.3-1 fixed the problem. Thanks a lot!

@logicalplane

Thank you for posting the "conda install" info, this fixed it for me and this problem was driving me crazy! I am glad there are folks who can figure these things out and then take the time to post and help others.

@EmZhu
EmZhu commented Feb 20, 2016

pip install colorama==0.3.5

fixed for me

@Liso77
Liso77 commented Mar 1, 2016

Look at https://github.com/ipython/ipython/pull/7765/commits to see how ipython community solved this problem.

We need not to patch colorama if we could add something like:

class SysOutput(QObject):
    @property
    def closed(self):
        return False # this could be probably more sofisticated :) 

to spyderlib/widgets/internalshell.py

edit: added @property decoration

@ccordoba12
Member

Isn't this a colorama bug?

@ccordoba12 ccordoba12 added this to the v3.0beta3 milestone Mar 1, 2016
@Liso77
Liso77 commented Mar 1, 2016

I am not sure. (And dont know who could be judge :) .

But it seems that "closed" is standard property of IOBase https://docs.python.org/3/library/io.html#module-io (which define interface for file-objects. See: https://docs.python.org/3/glossary.html#term-file-object )

BTW class SysOutput has also this similar functionality:

    # We need to add this method to fix Issue 1789
    def flush(self):
        pass

See: #1789

FYI: Under ubuntu 16.04, after colorama upgrade, spyder3 does not start.

@ccordoba12
Member

How did you install Spyder?

@malfatti
malfatti commented Mar 1, 2016

Just to add, on gentoo, spyder3.0.0dev, qt5.5.1 and pyqt5.5.1 it is the same. On colorama 0.3.6 spyder didn't start, but on 0.3.5 it is working fine. I didn't installed spyder, I'm running python bootstrap.py.

@Liso77
Liso77 commented Mar 2, 2016

I added @property decoration to "patch" code above. Sorry I had high fever yesterday so I tested only if spyder starts. (and without decoration it "returns" True and not False!)

I am on other machine I will check it later, but my spyder (98% probability) and colorama (for sure) are installed via apt-get from standard ubuntu repository. Ubuntu 16.04 is in Beta, but it's still big problem I am afraid.

I think we have implement full interface defined in IOBase (because we redirect sys.stdout and sys.stderr (in interpreter.py)) if we like to guarantee compatibility with colorama in the future:

ABC Stub Methods Mixin Methods and Properties
IOBase fileno, seek, and truncate close, closed, enter, exit, flush, isatty, iter, next, readable, readline, readlines, seekable, tell, writable, and writelines

I am not sure about RawIOBase, BufferedIOBase, TextIOBase.

@Liso77
Liso77 commented Mar 2, 2016

It seems that IOBase is not enough. See:

python3 -c "import sys;print(dir(sys.stdout))"

@nknezek
nknezek commented Mar 2, 2016

I had this problem as well. Similar internal console output. I'm on Mac OS X El Capitan. Home-brewed python3. spyder 3.0.0b2. with colorama v 0.3.6, the preference pane will not open at all.
After
pip3 install colorama==0.3.3
or
pip3 install colorama==0.3.3
the preferences pane displays without any errors on internal console output, but when I try to change a keyboard shortcut, spyder crashes.

@astromz
astromz commented Mar 2, 2016

Thanks for the tips folks!
I solved the problem with: pip install colorama==0.3.5

My system is OSX Yosemite, and a fresh installation of anaconda (Python 3.5.1 |Anaconda 2.5.0).

@jitseniesen
Member

Given the amount of people coming across this issue, I think it makes sense for us to add a property closed to SysOutput as @Liso77 suggests. I checked and this does resolve the issue, allowing spyder to work with colorama 0.3.6. I think it is at least arguable that the bug is spyder's, not colorama's (SysOutput is meant to replace std.stdout and the Python3 docs say that this is a file object, meaning that it has the closed property), but I feel we should add the work-around even if the bug is colorama's.

Given the uncertainty around what colorama expects and that requirements std.stdout replacements should satisfy, I'm not sure it is worthwhile to implement the other methods of IOBase etc.

@ccordoba12 ccordoba12 modified the milestone: v2.3.9, v3.0beta3 Mar 3, 2016
@ccordoba12
Member

Ok, I'll do the change and release 2.3.9 to fix it.

@Liso77
Liso77 commented Mar 10, 2016

BTW colorama 0.3.7 made fix 84 so spyder3 is now working on ubuntu 16.04 by default...

FYI they added function:

def is_stream_closed(stream):
    return not hasattr(stream, 'closed') or stream.closed

So probably who downgraded could try upgrade again (but see edit below!) (@astromz, @AlJohri, @nknezek, @EmZhu )

Edit: Sorry! If I understand well then colorama will deduce that SysOutput is closed - so we very probably still need to patch if we want to have colorama working

@luke314
luke314 commented Mar 13, 2016

Fix worked for me as well

lubuntu 15.10
created a new python 3.5 env (not root env) with all anaconda packages
got this SysOutput error when trying to edit preferences
downgrading colorama to 0.3.3 resolved the issue.

Will try to upgrade to 0.3.7 as 0.3.6 was installed with the original 3.5 env nextly.

Thanks and cheers!

@ccordoba12 ccordoba12 added a commit that closed this issue Mar 20, 2016
@ccordoba12 ccordoba12 Internal Console: Add a "closed" attribute to SysOutput to be a corre…
…ct replacement for sys.stdout

Fixes #2984
e5c4174
@florianGithub

Tried colorama downgrade solution without success:

I am runnig Anaconda2 4.0.0 on Windows 7 Pro.
In Spyer, when I clicked on Tools->Preferences I recieved the error message below in the internal console.
This lookes quite similar to the problem described above and so I downgraded colorama. Using "conda install colorama=0.3.3" when I was in the directory "C:\Program Files\Anaconda2\Scripts".

But when I click on Tools->Preferences in Spyder, I still get the error message:

C:\Program Files\Anaconda2\lib\site-packages\nbformat\current.py:19: UserWarning: nbformat.current is deprecated.

  • use nbformat for read/write/validate public API

  • use nbformat.vX directly to composing notebooks of a particular version

    """)
    C:\Program Files\Anaconda2\lib\site-packages\jupyter_client\localinterfaces.py:247: UserWarning: Unexpected error discovering local network interfaces: [Error 6] The handle is invalid
    warn("Unexpected error discovering local network interfaces: %s" % e)
    Traceback (most recent call last):
    File "C:\Program Files\Anaconda2\lib\site-packages\spyderlib\spyder.py", line 2008, in edit_preferences
    widget = plugin.create_configwidget(dlg)
    File "C:\Program Files\Anaconda2\lib\site-packages\spyderlib\plugins__init__.py", line 212, in create_configwidget
    configwidget.initialize()
    File "C:\Program Files\Anaconda2\lib\site-packages\spyderlib\plugins\externalconsole.py", line 58, in initialize
    PluginConfigPage.initialize(self)
    File "C:\Program Files\Anaconda2\lib\site-packages\spyderlib\plugins\configdialog.py", line 59, in initialize
    self.setup_page()
    File "C:\Program Files\Anaconda2\lib\site-packages\spyderlib\plugins\externalconsole.py", line 278, in setup_page
    interpreter=interpreter)
    File "C:\Program Files\Anaconda2\lib\site-packages\spyderlib\utils\programs.py", line 277, in is_module_installed
    stdout=subprocess.PIPE).communicate()
    File "C:\Program Files\Anaconda2\lib\subprocess.py", line 702, in init
    errread, errwrite), to_close = self._get_handles(stdin, stdout, stderr)
    File "C:\Program Files\Anaconda2\lib\subprocess.py", line 833, in _get_handles
    p2cread = self._make_inheritable(p2cread)
    File "C:\Program Files\Anaconda2\lib\subprocess.py", line 884, in _make_inheritable
    _subprocess.DUPLICATE_SAME_ACCESS)
    WindowsError: [Error 6] The handle is invalid

@hendiol
hendiol commented Sep 22, 2016

Have the same problem as described above, opening the preferences gives error messages

Version and main components

  • Spyder Version: 2.3.9
  • Python Version: 3.5.2
  • Qt Versions: 4.8.7, PyQt4 (API v2) 4.11.4 on Darwin

Optional dependencies

pyflakes >=0.6.0   :  1.2.3 (OK)
pep8 >=0.6         :  1.7.0 (OK)
pygments >=1.6     :  2.1.3 (OK)
IPython >=1.0      :  4.2.0 (OK)
zmq >=2.1.11       :  15.2.0 (OK)
qtconsole >=4.0    :  4.2.1 (OK)
pandas >=0.13.1    :  0.18.1 (OK)
sphinx >=0.6.6     :  1.4.1 (OK)
psutil >=0.3       :  4.3.0 (OK)
rope >=0.9.2       :  0.9.4-1 (OK)
jedi >=0.8.1;<0.9.0:  0.9.0 (NOK)
matplotlib >=1.0   :  1.5.1 (OK)
sympy >=0.7.3      :  1.0 (OK)
pylint >=0.25      :  None (NOK)

I use spyder 2.39 with python 3.5.2 and tried colorama 0.3.7 and colorama 0.3.3
by opening the preferences I get:

/Users/h_leusmann/anaconda/lib/python3.5/site-packages/nbformat/current.py:19: UserWarning: nbformat.current is deprecated.

  • use nbformat for read/write/validate public API

  • use nbformat.vX directly to composing notebooks of a particular version

    """)
    Traceback (most recent call last):
    File "/Users/h_leusmann/anaconda/lib/python3.5/site-packages/spyderlib/spyder.py", line 2000, in edit_preferences
    widget.initialize()
    File "/Users/h_leusmann/anaconda/lib/python3.5/site-packages/spyderlib/plugins/configdialog.py", line 59, in initialize
    self.setup_page()
    File "/Users/h_leusmann/anaconda/lib/python3.5/site-packages/spyderlib/plugins/shortcuts.py", line 338, in setup_page
    self.table = ShortcutsTable(self)
    File "/Users/h_leusmann/anaconda/lib/python3.5/site-packages/spyderlib/plugins/shortcuts.py", line 287, in init
    self.load_shortcuts()
    File "/Users/h_leusmann/anaconda/lib/python3.5/site-packages/spyderlib/plugins/shortcuts.py", line 297, in load_shortcuts
    shortcut = Shortcut(context, name, keystr)
    File "/Users/h_leusmann/anaconda/lib/python3.5/site-packages/spyderlib/plugins/shortcuts.py", line 110, in init
    key = keystr2key(key)
    File "/Users/h_leusmann/anaconda/lib/python3.5/site-packages/spyderlib/plugins/shortcuts.py", line 103, in keystr2key
    return Key(Key.key_from_str(keylist[-1]), *mods)
    File "/Users/h_leusmann/anaconda/lib/python3.5/site-packages/spyderlib/plugins/shortcuts.py", line 65, in init
    assert key in self.KEYS
    AssertionError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment