question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: jedi-vim fails to load with colorama 0.3.6

See original GitHub issue

After deploying a new system, jedi-vim fails to load with the following error message System: Fedora22


Error detected while processing /home/fedora/.vim/bundle/jedi-vim/autoload/jedi.vim:
line  283:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/fedora/.vim/bundle/jedi-vim/initialize.py", line 22, in <module>
    import jedi_vim
  File "/home/fedora/.vim/bundle/jedi-vim/jedi_vim.py", line 12, in <module>
    import jedi
  File "/usr/lib/python2.7/site-packages/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/usr/lib/python2.7/site-packages/jedi/api/__init__.py", line 16, in <module>
    from jedi.parser import Parser, load_grammar
  File "/usr/lib/python2.7/site-packages/jedi/parser/__init__.py", line 21, in <module>
    from jedi.parser import tree as pt
  File "/usr/lib/python2.7/site-packages/jedi/parser/tree.py", line 39, in <module>
    from jedi import cache
  File "/usr/lib/python2.7/site-packages/jedi/cache.py", line 32, in <module>
    from jedi import debug
  File "/usr/lib/python2.7/site-packages/jedi/debug.py", line 17, in <module>
    init()
  File "/usr/lib/python2.7/site-packages/colorama/initialise.py", line 37, in init
    wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
  File "/usr/lib/python2.7/site-packages/colorama/initialise.py", line 76, in wrap_stream
    convert=convert, strip=strip, autoreset=autoreset)
  File "/usr/lib/python2.7/site-packages/colorama/ansitowin32.py", line 67, in __init__
    strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
AttributeError: closed

EDIT Suggested fix for colorama: https://github.com/tartley/colorama/pull/84

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
blueyedcommented, Jan 22, 2016

The problem can be reproduced using:

vim -c 'VirtualEnvActivate' -c 'py import colorama; colorama.init()'

So, you need to have colorama 0.3.6 installed - and activated your virtualenv.

I only have colorama 0.3.3 (Arch is not up-to-date in that regard), and do not activate my virtualenvs (jedi-vim (Git master) picks up $VIRTUAL_ENV by itself).

1reaction
tarcisioecommented, Jan 20, 2016

This is what :py3 import colorama; colorama.init() causes on my Vim.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/tarcisioe/workspace/manta/.venv/lib64/python3.4/site-packages/colorama/initialise.py", line 37, in init
    wrap_stream(orig_stdout, convert, strip, autoreset, wrap)
  File "/home/tarcisioe/workspace/manta/.venv/lib64/python3.4/site-packages/colorama/initialise.py", line 76, in wrap_stream
    convert=convert, strip=strip, autoreset=autoreset)
  File "/home/tarcisioe/workspace/manta/.venv/lib64/python3.4/site-packages/colorama/ansitowin32.py", line 67, in __init__
    strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
AttributeError: 'vim.message' object has no attribute 'closed'

Sounds similar (the same, actually) to what @tony gets in his Neovim. I ended up having jedi-vim fail whenever I was working on a project that had pylint installed, because pylint depends on colorama>=0.3.5, and so I end up with 0.3.6. A friend of mine confirmed that replacing 0.3.6 with 0.3.5 fixes the issue and is enough for both jedi and pylint to work as expected, but doing this manually for every virtualenv I create is surely non-optimal.

Thanks for looking into it 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jedi completion crashes on Python 3 with pyenv ... - GitHub
Error: jedi-vim fails to load with colorama 0.3.6 #522 ... Error: jedi-vim failed to initialize Python: Could not setup ...
Read more >
Autocompletion with Jedi-vim gives Error - Stack Overflow
This is the error that I am getting when I look into the :messages in Vim. Please install Jedi if you want to...
Read more >
Colorama Package installed in Python - YouTube
A brief explanation about the COLORAMA package as well as how to install packages using PIP in the command prompt (or terminal for...
Read more >
python jedi client couldn't create connection to server - You.com ...
inserting data into SQL Server db using sqlalchemy gives error: 'Connection' object has no attribute 'cursor'. Asked Jan 30, 2020 • 0 votes...
Read more >
1753715 – vim-jedi is built using Python 2 while vim Dropped ...
Description of problem: Recently vim-jedi stopped working for me where it used to work fine. It now fails during start up. Version-Release number...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found