lambdalisue / vim-pyenv

Activate the versions and the virtualenvs of pyenv within a live VIM session
107 stars 5 forks source link

Macvim upgrade results in: vim-pyenv Failed to activate "env". Python version of the env is not supported in this Vim. #18

Closed dgonzo closed 8 years ago

dgonzo commented 8 years ago

I updated macvim this morning when prompted and get the error whenever I try an enable any python 3 environments.

Previous to the macvim update there were no issues. I already ran updated bundles with neoupdate.

I've included errors and settings below.

Error

vim-pyenv Failed to activate "virtualenv". Python version of the env is not supported in this Vim.

Settings

VIM via homebrew

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr  4 2016 02:34:27)
MacOS X (unix) version
Included patches: 1-1707

.vimrc

set nocompatible              " required
filetype off                  " required

"NeoBundle Scripts-----------------------------
if &compatible
  set nocompatible               " Be iMproved
endif

" Required:
set runtimepath^=/Users/gonzo/.vim/bundle/neobundle.vim/

" Required:
call neobundle#begin(expand('/Users/gonzo/.vim/bundle'))

" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'
NeoBundle 'Shougo/vimproc.vim', {
\ 'build' : {
\     'windows' : 'tools\\update-dll-mingw',
\     'cygwin' : 'make -f make_cygwin.mak',
\     'mac' : 'make',
\     'linux' : 'make',
\     'unix' : 'gmake',
\    },
\ }
"Add or remove your Bundles here:
NeoBundle 'tmhedberg/SimpylFold'
NeoBundle 'vim-scripts/indentpython.vim'
NeoBundle 'scrooloose/syntastic'
NeoBundle 'nvie/vim-flake8'
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'kien/ctrlp.vim'
NeoBundle 'altercation/vim-colors-solarized'
NeoBundle 'myusuf3/numbers.vim'
NeoBundle 'vim-airline/vim-airline'
NeoBundle 'vim-airline/vim-airline-themes'
NeoBundle 'edkolev/tmuxline.vim'
NeoBundle 'editorconfig/editorconfig-vim'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'tpope/vim-surround'
NeoBundle 'spf13/vim-autoclose'
NeoBundle 'majutsushi/tagbar'
NeoBundle 'easymotion/vim-easymotion'
NeoBundle 'tpope/vim-commentary'
NeoBundle 'Shougo/neosnippet.vim'
NeoBundle 'Shougo/neosnippet-snippets'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'ctrlpvim/ctrlp.vim'
NeoBundle 'flazz/vim-colorschemes'
NeoBundle 'ervandew/supertab'

" Do not load vim-pyenv until *.py is opened and
" make sure that it is loaded after jedi-vim is loaded.
NeoBundleLazy 'lambdalisue/vim-pyenv', {
        \ 'depends': ['davidhalter/jedi-vim'],
        \ 'autoload': {
        \   'filetypes': ['python', 'python3'],
        \ }}

" You can specify revision/branch/tag.
" NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }

" Required:
call neobundle#end()

" Required:
filetype plugin indent on

" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck
"End NeoBundle Scripts-------------------------

if jedi#init_python()
  function! s:jedi_auto_force_py_version() abort
    let major_version = pyenv#python#get_internal_major_version()
    call jedi#force_py_version(major_version)
  endfunction
  augroup vim-pyenv-custom-augroup
    autocmd! *
    autocmd User vim-pyenv-activate-post   call s:jedi_auto_force_py_version()
    autocmd User vim-pyenv-deactivate-post call s:jedi_auto_force_py_version()
  augroup END
endif

let mapleader = ","
set visualbell t_vb=
set noerrorbells
set splitbelow
set splitright
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
set foldmethod=indent
set foldlevel=99
nnoremap <space> za
let g:SimpylFold_docstring_preview=1
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
noremap <silent> <C-L> :NERDTreeToggle<CR><C-L>
let python_highlight_all=1
syntax on
set encoding=utf-8
set background=dark
colorscheme solarized
set guifont=Sauce\ Code\ Powerline\ Light:h13
let g:numbers_exclude = ['tagbar', 'gundo', 'minibufexpl', 'nerdtree']
nnoremap <F10> :NumbersToggle<CR>
nnoremap <F9> :NumbersOnOff<CR>
let g:airline_powerline_fonts = 1
set laststatus=2
let g:EditorConfig_exclude_patterns = ['fugitive://.*']
let g:ycm_path_to_python_interpreter = '/usr/bin/python'
set clipboard=unnamed
let g:autoclose_vim_commentmod = 1
nmap <F8> :TagbarToggle<CR>
" <Leader>f{char} to move to {char}
map  <Leader>f <Plug>(easymotion-bd-f)
nmap <Leader>f <Plug>(easymotion-overwin-f)

" s{char}{char} to move to {char}{char}
nmap s <Plug>(easymotion-overwin-f2)

" Move to line
map <Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader>L <Plug>(easymotion-overwin-line)

" Move to word
map  <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)
set colorcolumn=100
let g:jedi#use_splits_not_buffers = "left"

" Python
let g:syntastic_python_python_exec = 'python3'

Python environments

* system (set by /Users/gonzo/.python-version)
  2.7
  3.5.1
  3.5.1/envs/kraken-virtual-env-3.5.1
  kraken-virtual-env-3.5.1
  miniconda3-latest
dgonzo commented 8 years ago

When I created a new py27 environment and then try and edit a file I get this error:

"test.py" 0L, 0C
Error detected while processing function jedi#init_python:
line    7:
Error: jedi-vim failed to initialize Python: jedi#setup_py_version: Vim(pyfile):Traceback (most recent call last): (i
n function jedi#init_python[3]..<SNR>130_init_python[48]..jedi#setup_py_version, line 16)  

JediDebugInfo

Using Python version: 2

dgonzo commented 8 years ago

I fixed this with a reinstall of macvim:

brew install macvim --with-override-system-vim --with-python3 --with-cscope --with-lua --with-luajit

But it looks like building with dynamic linked python is no longer supported.

lambdalisue commented 8 years ago

As long as I know, macvim ends up to support dynamic linked python long time ago. Additionally it seems that brew install macvim use old git repository and the new one is moved to https://github.com/macvim-dev/homebrew-macvim