Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jedi-Vim throws exception on load #530

Closed
MikeDacre opened this issue Jan 18, 2016 · 7 comments
Closed

Jedi-Vim throws exception on load #530

MikeDacre opened this issue Jan 18, 2016 · 7 comments

Comments

@MikeDacre
Copy link

This error just started, and I have no idea what changed in my config to make it happen.

When I start vim on a python file now, I get the following message (don't know how to get a full traceback):

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

Output of :version:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 16 2016 17:14:30)
MacOS X (unix) version
Included patches: 1-1090
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         -gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
  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.9 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: /usr/bin/clang   -L. -L/usr/local/lib -L/usr/local/lib -F/usr/local/Frameworks -Wl,-headerpad_max_install_names -o vim        -lm  -lncurses -liconv -framework Cocoa   -fstack-protector -L/usr/local/lib  -L/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE -lperl -F/usr/local/Cellar/python/2.7.11/Frameworks -framework Python   -lruby.2.0.0 -lobjc    

Output of :JediDebugInfo:

Using Python version: 2
@davidhalter
Copy link
Owner

:py import jedi?

@MikeDacre
Copy link
Author

Thanks:

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

Looks like it is using the YCM Jedi, I prefer vim-jedi for python though. Is it easy to change the vim python runtime path to favor the root installed jedi?

@davidhalter
Copy link
Owner

I have no idea.

@davidhalter
Copy link
Owner

I'm wondering why this happens. settings.py should definitely be in the jedi folder.

@blueyed
Copy link
Collaborator

blueyed commented Jan 19, 2016

FWIW, I can reproduce this from the jedi-vim folder, where settings.py is in jedi/jedi/settings.py:

% python -c 'from jedi import settings'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'settings'

(this is obviously wrong of course - just something that might indicate something)

What is the output of :py import sys; print(sys.path) when this happens?

@davidhalter
Copy link
Owner

That's a very good question.

@blueyed
Copy link
Collaborator

blueyed commented Jan 19, 2016

Closing this as duplicate of #526.

@blueyed blueyed closed this as completed Jan 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants