-
Notifications
You must be signed in to change notification settings - Fork 28
Specify a path to the python program with the module installed #64
Comments
https://github.com/roxma/nvim-yarp#requirements
You can specify it by |
That's true for nvim-yarp, but not for this plugin. |
Hm. OK. |
No, that also doesn't work. It really does not seem that this plugin has that feature. This is the code from this plugin: if has('pythonx')
let g:neovim_rpc#py = 'pythonx'
let s:pyeval = function('pyxeval')
elseif has('python3')
let g:neovim_rpc#py = 'python3'
let s:pyeval = function('py3eval')
else
let g:neovim_rpc#py = 'python'
let s:pyeval = function('pyeval')
endif |
You can send PR for the plugin. |
Looking into this, I could not find a way to change the Python executable that is used for the interface. I could not find any information about it and it might be that this is already determined the moment the vim starts and cannot be changed afterwards. As a personal work-around I append the place where I install the pynvim package to sys.path: py3 sys.path.append('/home/hielke/.venv/py3/lib/python3.7/site-packages/') |
@hwalinga You can specify the path by
|
So this issue should be closed. |
@Shougo It may desirable to be using a project's virtual environment for other purposes, but to find the system-wide (or a different venv's) interpreter for pynvim. |
Assuming
|
Unfortunately, this is Vim's feature. |
One way to solve this is to figure out what python version is the vim runtime using :py3 print(sys.path) This output:
In my case it was probably the supplied Python with the MacOS. I'm using pyenv + virtualenvs normally in the terminal, but vim picks the OS Py, so probably a PATH issue. To fix the missing packages I just use /usr/local/opt/python/bin/python3 -m pip install pynvim |
I have multiple python virtual environments installed on my pc, but I don't want to install pynvim in all of them.
Would it be possible to specify a certain path to an python executable that has this module installed, instead of letting vim search in the PATH for the first python executable it can find?
The text was updated successfully, but these errors were encountered: