Help us understand the problem. What is going on with this article?

NeoVim用のPython環境を整える

More than 1 year has passed since last update.

社内の機械学習読書会のためにanaconda入れたら、NeoVimがPython3環境でneovimなんてモジュールねーよ!エラーを出し始めたので、ちゃんとする。何が辛いって、Denite動かなくなったのがツラい。

$ brew install pyenv
$ brew install pyenv-virtualenv

READMEにしたがって、パスを通しておく

~/.bash_profile
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

パスを通したら環境を作る

# インストール可能なPythonのバージョンを確認
$ pyenv install --list
# インストール済みのPythonバージョンを確認
$ pyenv versions

# python2環境
$ pyenv install 2.7.15
$ pyenv virtualenv 2.7.13 neovim2
$ pyenv activate neovim2
$ pip2 install neovim
$ pyenv which python

#python3環境
$ pyenv install 3.5.3
$ pyenv virtualenv 3.5.3 neovim3
$ pyenv activate neovim3
$ pip install neovim
$ pyenv which python

これで環境ができたので、NeoVimの設定ファイルにパスを書いておく

config/nvim/init.vim
" for Python
let g:python_host_prog = $PYENV_ROOT.'/versions/neovim2/bin/python'
let g:python3_host_prog = $PYENV_ROOT.'/versions/neovim3/bin/python'

:checkhealth で確認してOKなら成功。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away