1

I installed jedi-vim with Pathogen. I want it to use my anaconda python which is python 3.6 and not my system python. I have edited my $PATH variable in my .bashrc file to:

export PATH="/opt/anaconda/3-5.0.0.1/bin:$PATH"

and I have pip installed jedi for anaconda python.

When I try to edit a python file, I get the following error:

Error: jedi-vim failed to initialize Python: jedi#setup_python_imports: ImportError: No module named jedi (in function jedi#ini
t_python..<SNR>24_init_python..jedi#setup_python_imports, line 32). See :messages and/or :JediDebugInfo for more information.

Here is the output of :verbose JediDebugInfo:

##### Global Python

Using Python version 2 to access Jedi.
 - global sys.executable: `/opt/anaconda/3-5.0.0.1/bin/python`
 - global sys.version: `2.7.5 (default, Jun 11 2019, 14:33:56), [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]`
 - global site module: `/usr/lib64/python2.7/site.pyc`

some more info if it can help:

which python
/opt/anaconda/3-5.0.0.1/bin/python
which python2
/usr/bin/python2
which python3
/opt/anaconda/3-5.0.0.1/bin/python3
0

The jedi-vim plug-in doesn't just use the python3 binary, but also the Vim python integration through Python libraries. That's why just updating your $PATH to point at Anaconda Python is not enough to have jedi-vim use it.

Unfortunately, there's not really a great way to have your system Vim use the Python libraries from Anaconda, you usually need to build (as in, compile) Vim against the Python libraries you intend to use.

Fortunately, it seems there's a Vim package available from conda-forge, which should integrate well with the Anaconda Python.

You should be able to install it with:

conda install -c conda-forge vim

Once you have this package installed, make sure your $PATH is set up in a way that will pick that Vim binary and not the system one. jedi-vim should work well with that Vim binary together with the Anaconda Python.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.