Please complete these steps and check these boxes (by putting an x inside
the brackets) _before_ filing your issue:
vim --version.:YcmDebugInfo.:YcmToggleLogs command.install.py (or cmake/make/ninja) including its invocationThank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.
I only use archlinux and macOS, so I don't know how other linux distributions make python2 python3 exist together.
In archlinux, user install python package will add python and python3 to /usr/bin, install python2 package will only add python2 to /usr/bin. So, in fact, I always use python3 to compile YCM.
In macOS, most users use homebrew as package manager. user install python will add python2 to /usr/local/bin, install python3 will add python3 to /usr/local/bin.
I have read install.py script, and it use bash shebang. So #!/usr/bin/env python in macOS will always call the system python which I do not want to use.
Maybe use pyenv as python version manager will solve this problem, so is there some suggestions or instructions can help me?
Create symbol link python -> /usr/local/bin/python3 will work, but i think this is not compatible with macOS system python which also provide python in $PATH.
You can always run python3 install.py instead of ./install.py.
I use pyenv but Boris is right too. This applies to all supported platforms.
I think it is answered so closing.
For those that go down the rabbit hole of deciding hey yeah I should use pyenv too, here are instructions.
brew install pyenvpyenv repo. This includes adding to your .bash_profile the pyenv init script.pyenv install $VERSION where $VERSION is the version you want.If you happen to run into something like this when installing python3+
Downloading Python-3.6.5.tar.xz...
-> https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
Installing Python-3.6.5...
python-build: use readline from homebrew
BUILD FAILED (OS X 10.13.4 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/02/5gx3m36s321c68bwcq_p1lnm0000gp/T/python-build.20180622105052.49531
Results logged to /var/folders/02/5gx3m36s321c68bwcq_p1lnm0000gp/T/python-build.20180622105052.49531.log
Last 10 log lines:
File "/private/var/folders/02/5gx3m36s321c68bwcq_p1lnm0000gp/T/python-build.20180622105052.49531/Python-3.6.5/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/private/var/folders/02/5gx3m36s321c68bwcq_p1lnm0000gp/T/python-build.20180622105052.49531/Python-3.6.5/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/private/var/folders/02/5gx3m36s321c68bwcq_p1lnm0000gp/T/python-build.20180622105052.49531/Python-3.6.5/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/private/var/folders/02/5gx3m36s321c68bwcq_p1lnm0000gp/T/python-build.20180622105052.49531/Python-3.6.5/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip
zipimport.ZipImportError: can't decompress data; zlib not available
Try running xcode-select --install in your CLI as mentioned in this issue.
@meritozh
Create symbol link python -> /usr/local/bin/python3 will work, but i think this is not compatible with macOS system python which also provide python in $PATH.
maybe you could configure
let g:ycm_server_python_interpreter='/usr/local/bin/python3'
in you vimrc
Create symbol link python -> /usr/local/bin/python3
This is extraordinarily dangerous advice that might cause people to break their system Python :confused:
Don't listen to, appropriately named, extraordinarily dangerous advice and instead listen to what I and and puremourning said.
For further questions, contact us on gitter.
Most helpful comment
You can always run
python3 install.pyinstead of./install.py.