Make it abundantly clear that YouCompleteMe does not support Python3
Closed this issue · 9 comments
I had to install this package just to find out that YCM does not work with the latest default versions of Python (Python 3.x); I think that no support for the latest versions of Python should be right in the very first lines of any declarations of Python "support" and not just an error message you get after installing the package.
First of all what do you mean that it doesn't work? It crashes? The server do not start? Or you don't have the right completion? Even if your default version of Python is 3.x you have to have the vim compiled with the python3 interface; so what is the output of :version
?
I installed YCM from its Git repo and then started Vim; Upon that, I got the following warning:
YouCompleteMe unavailable: requires Vim compiled with Python 2.x support
It would have been nice to see that information right on the main documentation, where Python support is first introduced, not just buried somewhere deep and presented post installation of the package.
I've Vim installed with -python +python3
, because Vim can only load one version of Python per running instance (2 or 3), it is a major headache to get dynamic support for both versions, and I always need :py3
, and never :py
. So the mere fact that a plugin even just once calls :py
[INSERT: during startup] would break everything for me, because I then could not use :py3
.
I don't code in python so I'm just asking what happen if I run the YCM's python code base through a python3 interpreter? would it work? just in theory
Sadly enough no, major version upgrades of Python so far have always been backwards and forwards incompatible.
EDIT: at least from 1.x to 2.x and from 2.x to 3.x.
@fnl Before laying the blame on YCM, realize that the root of the problem is with Vim, not YCM. Vim can't have both python2 and python3 support compiled into the Vim binary. You could actually do that in theory, but Vim would crash if you loaded both a python2 and a python3 plugin since the two interpreters can't coexist is the same process. Furthermore, the vast majority of people use the Vim binary that comes with their distro and that's practically always only compiled with python2 support (because of the above issue).
Now realize that it doesn't really matter at all which version of Python YCM is running under, just which version of Python it can complete. Then realize that Jedi (the Python semantic engine YCM uses) only supports python3 completion if it's running under python3 (a fairly reasonable restriction).
The matter isn't entirely out of YCM's hands though; we could run ycmd under python3 to support Jedi's requirement, but it would be a massive time investment. A more sensible approach would be to pull Jedi out into a separate process and talk to that.
All of the above takes lots and lots of time and energy to implement and despite your anger over the lack of python3 support, the vast majority of Python devs use python2. And that's just one semantic engine in YCM out of several. So you're asking for a large time investment to address a very small percentage of YCM's users. It's going to happen, but it isn't a high priority currently.
@Valloric you somewhere along the lines got my report all wrong. I am neither angry and much less am I asking for Python3 support of YCM. All I was trying to tell you guys is that not only does YCM not support Python 3, you guys are even well aware of that fact and should stand up to it. Please just make it clear in your README that you don't support Python 3 instead of hiding that knowledge in a warning that crops up post-installation and save everybody some time.
@fnl I'm trying to tell you that the warning you got has nothing to do with YCM not supporting Python3 completion. Such support, when added, will still have that warning. The YCM client will always be written in Python2 since that's the interpreter that's always present in Vim. But that doesn't mean YCM will never be able to complete Python3.
Developing for Py3 with Vim running in Py2 mode is - at best - a pain in
the ass, as I can promise you from years of experience. Actually, I came
here looking for a C++ autocompletion tool rhat goes beyond omni, nothing
to do with Python, as your tool had been recommended to me as one of the
possible options for just that. Turns out, YCM does not work if you need
Py3 support in Vim, too. So I am sorry to hear it is beyond your pride to
add a line about that in your tool's readme. Maybe because you think
Python3 devs are an annoying minority?
On Aug 30, 2014 11:35 PM, "Val Markovic" notifications@github.com wrote:
@fnl https://github.com/fnl I'm trying to tell you that the warning you
got has nothing to do with YCM not supporting Python3 completion. Such
support, when added, will still have that warning. The YCM client will
always be written in Python2 since that's the interpreter that's always
present in Vim. But that doesn't mean YCM will never be able to complete
Python3.—
Reply to this email directly or view it on GitHub
#1140 (comment)
.
So I am sorry to hear it is beyond your pride to
add a line about that in your tool's readme. Maybe because you think
Python3 devs are an annoying minority?
Everyone communicating on the YCM issue tracker and mailing lists is required to remain civil and courteous to others, no matter what the disagreement. If you are unable to follow these rules, you will be banned from further interaction.
Consider this to be your first and only warning.
Developing for Py3 with Vim running in Py2 mode is - at best - a pain in
the ass, as I can promise you from years of experience.
It probably is, but that's unfortunately out of my hands. Like I said, Vim's/Python's limits are the root cause for not being able to run both interpreters in a process and since ~all distros ship Vim compiled with only Python2 support, that's just the reality of the situation.
Notwithstanding the "run under Python3 inside Vim" limit which is unlikely to ever go way because of the above listed reasons, I consider the lack of Python3 completion support to be a bug than needs to be fixed, and as such it is tracked on the issue tracker. Like any bug, it doesn't get listed "in the very first lines of the README" since that would both never scale and would pointlessly duplicate the issue tracker.