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.

jedi-vim failed to initialize Python: ":py/py3 import jedi" gives "ImportError: cannot import name 'settings'"

See original GitHub issue

I get the following error every time I start VIM

Error: jedi-vim failed to initialize Python: jedi#setup_py_version: Vim(py3file):Traceback (most recent call last): (in function jedi#init_python[3]..<SNR>72_init_python[50]..jedi
#setup_py_version, line 18)

I am running on Mac OS X El Captain 10.11.2. Vim is version 7.4.1063, python is version 3.4.3. Jedi is 0.9.0. Both python and vim are installed using brew, vim is installed using --with-python3 flag. :py3 command works, but trying to do :py3 import jedi results in the following

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/wombat/.vim/bundle/jedi-vim/jedi/jedi/__init__.py", line 41, in <module>
    from jedi.api import Script, Interpreter, NotFoundError, set_debug_function
  File "/Users/wombat/.vim/bundle/jedi-vim/jedi/jedi/api/__init__.py", line 16, in <module>
    from jedi.parser import Parser, load_grammar
  File "/Users/wombat/.vim/bundle/jedi-vim/jedi/jedi/parser/__init__.py", line 21, in <module>
    from jedi.parser import tree as pt
  File "/Users/wombat/.vim/bundle/jedi-vim/jedi/jedi/parser/tree.py", line 39, in <module>
    from jedi import cache
  File "/Users/wombat/.vim/bundle/jedi-vim/jedi/jedi/cache.py", line 30, in <module>
    from jedi import settings
ImportError: cannot import name 'settings'

I tried reinstalling everything and re-installing vim with env vi_cv_path_python=/usr/local/bin/python3 brew install --force vim --with-python3 command as was suggested in a similar issue.

Here is :version output for more info.

:version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 13 2016 15:58:04)
MacOS X (unix) version
Included patches: 1-1063
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +cmdline_info    +emacs_tags      -hangul_input    +menu            +mouse_xterm     +python3         +syntax          +virtualedit     -xsmp
+arabic          +comments        +eval            +iconv           +mksession       +multi_byte      +quickfix        +tag_binary      +visual          -xterm_clipboard
+autocmd         +conceal         +ex_extra        +insert_expand   +modify_fname    +multi_lang      +reltime         +tag_old_static  +visualextra     -xterm_save
-balloon_eval    +cryptv          +extra_search    +jumplist        +mouse           -mzscheme        +rightleft       -tag_any_white   +viminfo         -xpm
-browse          +cscope          +farsi           +keymap          -mouseshape      +netbeans_intg   +ruby            -tcl             +vreplace
++builtin_terms  +cursorbind      +file_in_path    +langmap         +mouse_dec       +path_extra      +scrollbind      +terminfo        +wildignore
+byte_offset     +cursorshape     +find_in_path    +libcall         -mouse_gpm       +perl            +signs           +termresponse    +wildmenu
+cindent         +dialog_con      +float           +linebreak       -mouse_jsbterm   +persistent_undo +smartindent     +textobjects     +windows
-clientserver    +diff            +folding         +lispindent      +mouse_netterm   +postscript      -sniff           +title           +writebackup
+clipboard       +digraphs        -footer          +listcmds        +mouse_sgr       +printer         +startuptime     -toolbar         -X11
+cmdline_compl   -dnd             +fork()          +localmap        -mouse_sysmouse  +profile         +statusline      +user_commands   -xfontset
+cmdline_hist    -ebcdic          -gettext         -lua             +mouse_urxvt     -python          -sun_workshop    +vertsplit       -xim
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H   -F/usr/local/Frameworks -DMACOS_X_UNIX  -Os -w -pipe -march=native -mmacosx-version-min=10.11 -U_FORTIFY_SOURCE -D_FOR
TIFY_SOURCE=1
Linking: /usr/bin/clang   -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -F/usr/local/Frameworks -
Wl,-headerpad_max_install_names -o vim        -lm  -lncurses -liconv -framework Cocoa   -fstack-protector  -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl  -L/u
sr/local/Cellar/python3/3.4.3_2/Frameworks/Python.framework/Versions/3.4/lib/python3.4/config-3.4m -lpython3.4m -framework CoreFoundation  -lruby.2.2.0 -lobjc -L/usr/local/Cellar/
ruby/2.2.3/lib

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:53 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dendisuhubdycommented, Jul 3, 2018

Weird it happened to me today, my Python is 3.7

0reactions
davidhaltercommented, Jul 6, 2018

Please refer to this comment https://github.com/davidhalter/jedi-vim/issues/841#issuecomment-402297069

I’m pretty sure it’s an issue on brew with 3.7.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jedi-vim cannot initialize python - Stack Overflow
Error: jedi-vim failed to initialize Python: jedi#setup_python_imports: ImportError: No module named jedi (in function jedi#ini t_python.
Read more >
jedi-vim cannot initialize python
Error: jedi-vim failed to initialize Python: jedi#setup_python_imports: ImportError: No module named jedi (in function jedi#ini t_python.
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 >
Error detected while processing function jedi#init_python[11 ...
Error : jedi-vim failed to initialize Python: jedi#setup_python_imports: ModuleNotFoundError: No module named 'jedi' (in function ...
Read more >
ChangeLog - ftp
Change the error when an overlay image is not writable into a warning that ... when typing is imported with other names (#309)...
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