lambdalisue / vim-pyenv

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

Error detected while processing function pyenv#activate #14

Closed samuell closed 9 years ago

samuell commented 9 years ago

I have a .vimrc file with only (everything else commented out):

execute pathogen#infect()
syntax on
filetype plugin indent on

... and only vim-pyenv in ~/.vim/bundle/.

Still I get the following errors when opening vim:

"~/.vimrc" 85L, 2853C^[[>1;2802;0c
Error detected while processing function pyenv#activate..<SNR>18_activate..pyenv#python#exec_code..<SNR>42_exec_code:
line    4:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function pyenv#activate..<SNR>18_activate..pyenv#python#exec_code..<SNR>42_exec_code:
line    4:
  File "<string>", line 1, in <module>
Press ENTER or type command to continue
Error detected while processing function pyenv#activate..<SNR>18_activate..pyenv#python#exec_code..<SNR>42_exec_code:
line    4:
AttributeError: 'module' object has no attribute 'vars'

System info:

Any hints are very welcome.

samuell commented 9 years ago

I don't see this error on my laptop though, (running Xubuntu 14.04 LTS 64bit).

samuell commented 9 years ago

Well, I'm figuring now this might have to do with an over-loaded NFS-mounted storage, that my home-directory resides on, on the actual system :/ ... will continue to investigate ...

samuell commented 9 years ago

Well, it turns out the vim python module on that other system is missing the 'vars' attribute, among others.

If I run:

:python import vim; print 'vars' in dir(vim)

Then on the Scientific Linux system, i get "False", while on Xubuntu, I get "True".

Actually, there is quite a difference in the attributes list:

On Scientific Linux:

:python import vim; print dir(vim)
['__doc__', '__name__', '__package__', 'buffers', 'command', 'current', 'error', 'eval', 'windows']

On Xubuntu

:python import vim; print dir(vim)
['Buffer', 'Dictionary', 'Function', 'List', 'Options', 'Range', 'TabPage', 'VAR_DEF_SCOPE', 'VAR_FIXED'
, 'VAR_LOCKED', 'VAR_SCOPE', 'VIM_SPECIAL_PATH', 'Window', '_Loader', '__doc__', '__name__', '__package_
_', '_chdir', '_fchdir', '_find_module', '_get_paths', '_getcwd', '_load_module', 'bindeval', 'buffers',
 'chdir', 'command', 'current', 'error', 'eval', 'fchdir', 'find_module', 'foreach_rtp', 'options', 'os'
, 'path_hook', 'strwidth', 'tabpages', 'vars', 'vvars', 'windows']
samuell commented 9 years ago

Ok, solved this now by compiling my own vim 7.4 in my home folder.

Just for reference:

cd vim74
./configure --disable-gui --enable-pythoninterp --prefix=$HOME
make
make install
lambdalisue commented 9 years ago

Just for mention.

VIM: VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Apr 5 2012 05:28:37)

All of my vim plugins, including vim-pyenv, does not support Vim earlier than 7.3 (most does not support 7.3 as well).

samuell commented 9 years ago

@lambdalisue : Thanks, good to know!