pythonpython-3.xvimmacvim

How to get my Vim and MacVim to find python3?


When I use a plugin that requires python, it can't find it and barfs.

The places that seem to being searched are:

enter image description here

Using -version I see both:

+python/dyn        
+python3/dyn

However :echo has("python3") returns 0.

I'm not sure if this is compile time config, or runtime-configurable via .vimrc.

I'm not a python developer, and the few times I've ventured into that world were in the middle of the python2/python3 mess that turned me off completely. I've played around enough to have configured pyenv it seems, and get

╰─$ which python
/Users/benlieb/.pyenv/shims/python

╰─$ python --version
Python 3.10.3

Can anyone help shed light on what to do to get python3 findable/usable in my vim?

Update:

Following @romainl's suggestion below I set in my .vimrc

set pythonthreedll=/Users/benlieb/.pyenv/shims/python

But getting the following error:

enter image description here


Solution

  • After some time, I found the following works, thought it was not a fun path of discovery.

    let &pythonthreedll = trim(system("pyenv which python"))