Closed realh closed 7 years ago
Wouldn't be a better approach to use a virtualenv
? Looks like is mentioned in the README of fakegit as well on how to use it. Once you have the virtualenv you can either set g:ycm_python_binary_path
to the Python binary inside the virtualenv
or you can do it at runtime with YcmCompleter Restart <path_to_binary_of_virtyalenv>
. I think this would be nicer instead of acting directly on the PYTHONPATH. But I'm not a Python dev so maybe @micbou knows better?
fakegir's README also says that the virtualenv method doesn't seem to work with python3, which is what I want to use.
fakegir's README also says that the virtualenv method doesn't seem to work with python3, which is what I want to use.
Did you try? I was able to get some completions of the gi
module by copying the ~/.cache/fakegir
folder to the site-packages
of a Python 3 virtualenv created with pyenv-virtualenv
.
The author of the fakegir script says:
The other option which I use is to create a virtualenv and copy the fakegir gi package into it:
mkvirtualenv fakegir cdvirtualenv cd lib/python*/site-packages cp -a ~/.cache/fakegir/gi .
This appears to be what @micbou has had success with. So, you could try that? Adding yet more options for a very specific use case is not really something we want to do. Closing this for now, as it seems there is a workaround. We can re-open if there really is a bug or a feature request that will benefit large numbers of users.
Issue Prelude
Please complete these steps and check these boxes (by putting an
x
inside the brackets) before filing your issue:vim --version
.:YcmDebugInfo
.:YcmToggleLogs
command.Issue Details
I've been struggling to get ycm to support GObject Introspection via fakegir. fakegir's build-jedi-cache.sh didn't seem to do enough to get it working so I created a simple wrapper script to add ~/.cache/fakegir to PYTHONPATH and set its path in
g:ycm_python_binary_path
.It would be easier if YCM had another variable to override PYTHONPATH instead of having to create a wrapper script.