Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neovim python-client when using in a virtualenv #16

Closed
diefans opened this issue Aug 8, 2014 · 9 comments
Closed

neovim python-client when using in a virtualenv #16

diefans opened this issue Aug 8, 2014 · 9 comments

Comments

@diefans
Copy link
Contributor

diefans commented Aug 8, 2014

This is not a bug, but a documentation suggestion.

I tried out neovim with YouCompleteMe and all my python plugins (python-mode, virtualenv) enabled. Everything works fine and all vim plugins are loaded.

But when someone works within a virtualenv the thing is breaking. My solution to this is to install the python client into a virtualenv itself and setting PYTHONPATH=~/.virtualenvs/neovim/lib/python2.7/site-packages

@tarruda
Copy link
Member

tarruda commented Aug 8, 2014

I use pyenv and ran into a similar problem, could you send a PR with some notes for pyenv/virtualenv users?

@sethwoodworth
Copy link

Are you appending that PYTHONPATH to the active PYTHONPATH when you've loaded a virtualenv? I am going to need to solve this too, and I'm not sure how best to go about it.

@diefans
Copy link
Contributor Author

diefans commented Jan 20, 2015

its just in my .bashrc, so neovim will be available in the system env and also in every activated virtualenv.

when there is a new nvim/neovim release, just workon neovim && pip install -U neovim && deactivate

I always activate the project specific virtual env before running vim, I don't switch between virtual envs within an edit session (by vim plugins) - so I cannot tell you if there are any issues with that...

@xanderdunn
Copy link

@tarruda How did you solve this while using pyenv virtualenv? Adding to my PYTHONPATH the location of site-packages that include the neovim package doesn't seem to be solving the problem for me. When I have pyenv enabled for anything but the system package, neovim doesn't find Python.

@xanderdunn
Copy link

It looks like pointing neovim to my Homebrew Python installation did it: let g:python_host_prog = '/usr/local/bin/python'

@dylansm
Copy link

dylansm commented Nov 18, 2015

@xanderdunn Thank you for that—that did the trick for me after much difficulty.

@syclee
Copy link

syclee commented May 4, 2016

@xanderdunn Worked for me too, cheers.

@tweekmonster
Copy link

I wrote up a wiki about setting up Neovim with Python: https://github.com/tweekmonster/nvim-python-doctor/wiki

There's a page dedicated to pyenv which could be helpful to new Neovim users.

@justinmk
Copy link
Member

I think this was resolved by :CheckHealth, @tweekmonster LMK if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants