0

I have added both python 2.7 and 3.4 to my system path. Personally I use python 3.4, however I use Vim as my editor and one of the plugins I use requires python 2.7 to be first in the path. This is annoying because now when I use the python command in the windows command line it loads python 2.7 rather than 3.4

Is there any way that I can add python 2.7 to the windows path just for vim? And make the command line load python 3.4?

EDIT: the plugin that requires python 2.7 is YouCompleteMe (https://github.com/Valloric/YouCompleteMe)

Danny Herbert
  • 2,002
  • 1
  • 18
  • 26
  • Different plugins use Python differently: running explicitly with external command, using hashbang to run Python scripts, using the internal python support, and the answer would differ considerably depending on which of these is used. However, I don't know how to tell them apart in "one of the plugins I use". Can you be more specific? – Amadan Sep 08 '14 at 02:02
  • The `ycm_path_to_python_interpreter` configuration option isn’t what you’re looking for, right? – poke Sep 08 '14 at 02:17

3 Answers3

2

I needed this ability not because of Python versions but because of overbearing security policy. Where I work all persistent environment variables are privileged, so I put the following in my vimrc:

" Setup path
let $PATH.=';d:\python27;d:\python27\scripts'
let $PATH.=';d:\mingw\bin;d:\MinGW\msys\1.0\bin'
etc...
kitsu.eb
  • 2,996
  • 1
  • 26
  • 28
1
:help g:ycm_path_to_python_interpreter

In a doubt, reading the docs helps :)

Amadan
  • 191,408
  • 23
  • 240
  • 301
0

A possible solution is to use a python version manager leave the system python version at 2.7 and install any other version you desire through the version manager. An entire topic on python version mangers: https://stackoverflow.com/a/2812484/2745082

You can always rebuild the plugin to use python 3.4 if a version manger is to much trouble.

Community
  • 1
  • 1
Renlar
  • 11
  • 4