I'm trying to setup deoplete for Vim in mac os. One requirement for this is to install
pynvim which I did with
pip3 install pynvim
Now within Vim,
:python3 import pynvim throws an error
ImportError: No module named pynvim. However, outside Vim,
pip3 list lists the package
pynvim. I don't understand what is going wrong here.
I have collected some information based on which I think I should be able to get some help to prevent this error.
- From Vim,
- From Vim,
python3 help('modules')doesn't list the package
pynvim. Interesting thing here is that
python3 help('modules')also shows a warning
/firstname.lastname@example.org/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/distutils_patch.py:25: UserWarning: Distutils was imported before Setuptools. This usage is discou raged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.From this warning, we can see the Vim environment is using python3.8 and not python3.6 which conflicts with what was returned from
pip 20.2.1 from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip (python 3.6)
ls -l /usr/local/bin/python*shows
/usr/local/bin/python -> /usr/local/bin/python3.6 /usr/local/bin/python3 -> ../Cellaremail@example.com/3.8.5/bin/python3 /usr/local/bin/python3-config -> ../Cellarfirstname.lastname@example.org/3.8.5/bin/python3-config /usr/local/bin/python3.6 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 /usr/local/bin/python3.6-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config /usr/local/bin/python3.6m -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m /usr/local/bin/python3.6m-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m-config /usr/local/bin/python3.8 -> ../Cellaremail@example.com/3.8.5/bin/python3.8 /usr/local/bin/python3.8-config -> ../Cellarfirstname.lastname@example.org/3.8.5/bin/python3.8-config
Looks multiple Python version on my mac has messed up things. How do I get rid of this mess and prevent the Vim error?