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)

2
  • 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? Commented Sep 8, 2014 at 2:02
  • The ycm_path_to_python_interpreter configuration option isn’t what you’re looking for, right? Commented Sep 8, 2014 at 2:17

3 Answers 3

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... 
Sign up to request clarification or add additional context in comments.

Comments

1
:help g:ycm_path_to_python_interpreter 

In a doubt, reading the docs helps :)

Comments

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.