I am trying to install the UltiSnips plugin using vim-plug (for everything else, vim-plug works just fine). I put this:

call plug#begin('~/.vim/plugged')
    Plug 'sirver/ultisnips'
call plug#end()

It will save and I can successfully perform :PlugInstall and even edit text in MacVim. But when I go back into the .vimrc and trying to insert anything, I get the following error:

(This is all that is in the `.vimrc`)

Error detected while processing TextChangedI Autocommands for "*"..script /Users
line    7:
E319: Sorry, the command is not available in this version: py3 import vim

Running :py3 import sys;print("%x" % sys.maxsize, sys.maxsize > 2**32), I get 7fffffffffffffff True, showing python3 both works and is 64-bit.

Edit: I just ran :echo has("python") and :echo has("python3") and got 1 and 0 respectively. So apparently, I do have python but not python 3.

  • Welcome to Vi and Vim! That's odd... Does :py3 import vim work? (Wondering about the Python module named "vim", though I haven't seen that fail if :py3 is available.) When you use :version, do you see +python3 or +python3/dyn there? (Perhaps include output of :version and/or vim --version in your question.) Is it possible you have two versions of Vim installed and they have different settings such as Python support in only one of them?
    – filbranden
    Commented Dec 9, 2021 at 4:33
  • @filbranden +python3/dyn is there (along with +python/dyn). When I try :py3 import vim, it just sends the cursor back to the top like any other :py3 import [package]. I have deleted and re-downloaded Vim and MacVim a few times but, as far as I can tell, there is only one version of Vim installed currently.
    – grepgrok
    Commented Dec 9, 2021 at 5:14
  • One more possibility, when you have both +python/dyn (for Python 2) and +python3/dyn for Python 3, then the first command that you execute (:py vs :py3) will determine which version of Python is available, and the other version is not... Is it maybe possible that something is loading Python 2 first and that's breaking Python 3 that's required by UltiSnips?
    – filbranden
    Commented Dec 9, 2021 at 5:17
  • @filbranden I see how something could be calling Python 2 before Python 3. This is literally the first thing in vimrc and even if I put something like :py3 1+1 on the very first line, I get E319: Sorry, the command is not available in this version: :py3 1+1
    – grepgrok
    Commented Dec 9, 2021 at 5:59
  • Sorry, I DON'T see how something could be calling py2 before py3
    – grepgrok
    Commented Dec 9, 2021 at 6:07


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.