Bohr
Bohr

Reputation: 1726

Vim startup with ImportError: No module named UltiSnips

I have just compiled vim with python support, which works fine for almost all python based vim plugins like Gundo and YouCompleteMe, except for UltiSnips. Surprisingly with the same vim dot files, the ubuntu shipped vim package works fine with UltiSnips. So I guess there is something python related wrong with my compiled vim.(I don't get any error messages when compiling or installing vim and there's no conflicts between the two vim installations.)

The error occurs when vim is executing this command at startup: exec g:_uspy "from UltiSnips import UltiSnips_Manager", which is the same by typing :python from UltiSnips import UltiSnips_Manager on the command line. So I execute this command on both the compiled vim and shipped vim. The former fails while the later succeeds.

I know little about python. But I have tried to figure out if a module load path(sys.path) differs between two vim installations, which turns out is the same! So what is wrong? My compiled vim can do almost anything with the python interface. Why on the earth it can not import this particular module??

Here is the contents of UltiSnips's sub-folder 'plugin' which is in the python module load path:

ultisnips/plugin
├── snipMate_compatibility.vim
├── UltiSnips
│   ├── compatibility.py
│   ├── compatibility_py2.py
│   ├── _vim.pyc
│   └── ......
└── UltiSnips.vim

Upvotes: 2

Views: 1665

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172628

Patch 7.3.1163 has introduced additional search paths for Python scripts (to make writing Python-based plugins easier). Apparently, this has introduced a regression with some existing plugins. See this discussion on vim_dev.

If you're compiling Vim from the Mercurial repository, revert to a version before patch 7.3.1163 (with hg update REV), and stay there until the issue is resolved in a future patch.

Upvotes: 2

Related Questions