-
-
Notifications
You must be signed in to change notification settings - Fork 372
Autocompletion for virtual environment modules working in Python 2 but not in Python 3 #503
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
Comments
There is no way to do Python 3 + Virtualenv on vim as of December 20, 2015. I was going to do a project in pure Python 3.5, however came to a surprise when other packages relied upon for handling virtualenv didn't work with python 3.x virtualenvs. To see why, see the tickets linked to below.
Are you sure the virtualenv is really activated in python 3? Do you use a separate plugin for your virtualenv? With -python +python3, what you're experiencing may be because virtualenv isn't activating and you're only getting completion for the standard lib packages. On neovim, it's possible to simulate +python and +python3 simultaneously. I've had working jedi completion, but like you, only for standard library packages. Related issues, #467, jmcantrell/vim-virtualenv#45, python-mode/python-mode#406 Related reddit thread: https://www.reddit.com/r/vim/comments/2j0fxc/python_3_completion_vim_plugins/ |
Any news on this? Looks like there's been some movement on some of the issues @tony referenced since his previous comment. Would be great to get jedi-vim working with python3! |
It certainly is possible, and you might only be missing the virtualenv activation. |
neovim (and pip install neovim in the relevant virtualenv) worked for me. Thanks! Could you say more about how to make it work in vanilla vim? Do I need to do something more than activate the virtualenv in the shell from which I run I agree pyenv and pyenv-virtualenv are great, but I don't see how they are relevant to this problem. Am I missing something? |
Virtualenv support is still broken in Jedi. I plan to tackle it soon. (This issue: davidhalter/jedi#385). Because until Jedi really supports it, it's just not a clean solution. |
Thanks. In this meantime, for anyone reading this: I got things working for python3 virtual environments using the following ugly hack, which I added to the end of my
This works in the sense that the |
Will be fixed with davidhalter/jedi#385 |
With vim compiled with +python -python3 and with a Python 2 virtual environment activated, completion works for everything.
With vim compiled with -python +python3 and with a Python 3.5 virtual environment (created with the pyvenv tool) completion works for everything except for modules installed in the virtual environment.
The text was updated successfully, but these errors were encountered: