You are using pyenv and virtualenv is unused
PYENV_ROOT is directly under your home directory
By default, jedi-vim, which is a plugin of vim, refers to python of the system even if python used by pyenv etc. is switched. For this reason, it does not complement the library installed in python set in anaconda or pyenv. I want to complement this.
jedi-vim complements the library in python's sys.path, so if you add anaconda's site-packages here, it will be complemented. There are two solutions, one is to rewrite sys.path directly when reading the python file with ftplugin, and the other is to have the pth file read.
ftplugin Put python.vim in the .vim / ftplugin folder
python << EOF
import os
import sys
path = os.path.expanduser("~/.pyenv/versions/anaconda-2.3.0/lib/python2.7/site-packages")
if not path in sys.path:
sys.path.append(path)
EOF
Place the reference as anaconda.pth (anything is fine if the file name is .pth) under /Library/Python/2.7/site-packages You need sudo privileges to edit in / Library / Python / site-packages
~/.pyenv/versions/anaconda-2.3.0/lib/python2.7/site-packages
If you start vim and execute the following, if the added path is included, it is successful.
:py print(sys.path)
Recommended Posts