How to enable Python 3 support without compiling Python 3 within Vim?
See original GitHub issueAbout half of the time I develop using Python 2 and the other half of the time I develop using Python 3. But it seems that Jedi is unable to understand that even though /usr/bin/env python
will return in a Python 3 interpreter within those Python 3 virtualenvs and always goes to Python 2 instead.
The result is that when I do a <leader>g
I go to the Python 2 version instead of the Python 3 version which can be quite different.
I’ve tried forcing Jedi to use Python 3 using this setting:
let g:jedi#force_py_version = 3
But that results in:
Error: jedi-vim failed to initialize Python: Could not setup g:jedi#force_py_version: jedi#setup_py_version: Vim(py3file):E319: Sorry, the command is not available in this version: py3file ~/.vim/bun
dle/jedi-vim/initialize.py (in function jedi#init_python[3]..<SNR>98_init_python, line 6)```
Since I run Vim through homebrew (as most OS X developers would), I unfortunately can’t build both Python 2 and Python 3 support into Vim. The install options for Vim through homebrew:
--disable-nls
Build vim without National Language Support (translated messages, keymaps)
--override-system-vi
Override system vi
--with-client-server
Enable client/server mode
--with-lua
Build vim with lua support
--with-luajit
Build with luajit support
--with-mzscheme
Build vim with mzscheme support
--with-python3
Build vim with python3 instead of python[2] support
--with-tcl
Build vim with tcl support
--without-perl
Build vim without perl support
--without-python
Build vim without python support
--without-ruby
Build vim without ruby support
--HEAD
Install HEAD version
Is there any other way to fix this?
Thinking about it, even being able to modify the search path for GotoDefinition would probably fix the issue as well but I don’t see an option similar to that anywhere in the docs either.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
It works quite good for me using Neovim, which supports Python 2 and 3 in parallel better than Vim. But then I’m mostly working on Python 3 anyway.
What is
<leader>g
doing in your config? Is it based on virtualenvs?Ok, I’ll give that a try. Thank you so much for the help 😃