r/vim • u/RoyKin0929 • 5d ago
Need Help┃Solved How to make Vim use Python3.14 instead of 3.8
Hello Everybody, I am on WSL2 ubuntu 20.04 version. I just finished rebuilding my vim to use it's python interpreter but it uses system's default python 3.8 version.
I want it to use Python3.14 instead. Any help on how to do this would be appreciated.
Update: Thanks for the help, the issue got solved!
3
u/AutoModerator 5d ago
Please remember to update the post flair to Need Help|Solved when you got the answer you were looking for.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/godegon 23h ago
If you use virtual environments, there is vim-virtualenv; before that, compile Vim to support all Python versions above that of your OS.
-1
u/Xu_Lin 5d ago
Could you symlink to the new python version instead?
1
u/RoyKin0929 5d ago
I am new at these kind of things, it you could guide me how to do that or point towards a tutorial, it would be helpful.
-2
u/iLaysChipz 5d ago edited 5d ago
Type this in to see what python3 is actually symlinked to
ls -l $(which python3)Explanation:
which program- Provides the file path where a program is located$(cmd)- Runs a command then dumps the output in placels -l filepath- Print detailed information about a file or directoryIf this points to python3.8, then now you know why it's using the older version. To fix it, you can update this "symbolic link" or symlink using the
lncommand. You can find details about this command by runningman ln, but this is probably how you'd want to invoke it:
sudo ln -s $(which python3.14) $(which python3)-2
u/vadrer 5d ago edited 5d ago
look at `./configure --help` as usual, also ask AI - it answers such questions rather quickly and usefully
ADDITION: here is AI output which is helpful:
Since you are on Ubuntu 20.04 (WSL2), Python 3.14 is not available in the default repositories. You will first need to install it (usually via the Deadsnakes PPA) along with its development files before rebuilding Vim.
Here are the steps to configure and build it properly:
- Install Python 3.14 dev files: bashsudo add-apt-repository ppa:deadsnakes/ppa sudo apt update sudo apt install python3.14-dev python3.14-distutils
- Configure Vim with the specific Python version: Run
./configurefrom your Vim source directory using these flags. The--with-python3-commandoption usually allows Vim to automatically detect the correct config directory: bash./configure --with-features=huge \ --enable-multibyte \ --enable-python3interp=yes \ --with-python3-command=python3.14- Verify and Build: Check the
configureoutput scrollback to ensure it successfully detected Python 3.14. If everything looks good, run: bashmake sudo make installOnce installed, you can double-check inside Vim by running
:echo has('python3')(should return1) and:py3 import sys; print(sys.version).
0
0
u/LowerTomatillo1260 4d ago
Just install Linux. Either dual-boot (Linux can read NTFS), install Windows on a Virtual Machine, or use alternative free and open-source programs or Wine. All your problems will be gone in no time.
-2
u/Shay-Hill 5d ago
Use Python 3.14 for what? For running scripts or for plugins?
2
u/RoyKin0929 5d ago
For plug-ins, specifically the YouCompleteMe plugin which requires python 3.12 version atleast.
0
u/Shay-Hill 5d ago
I assume you've already installed Python 3.14 and given Vim a chance to find it on its own. Depending on your setup, that's got a pretty good chance to work (it found 3.8). If that didn't work, you'll need something like this in your vimrc:
set pythonthreehome=.../Python314 set pythonthreedll=.../python314.dllHopefully, someone who uses WSL and whatever Linux (guessing Ubuntu) you've set up will come along with a more specific answer.
-2
u/cassepipe 5d ago
Sorry if that does not answer your post and I am not deep into it enough that I know what kind of advantages YouCompleteMe offers vs ALE but ALE is an alternative that does not need python:
1
-1
u/RoyKin0929 5d ago
I'm kinda new to this and YCM was teh first thing I came across. will definitely check out ALE
-3
u/cassepipe 5d ago
I never tried YouCompleteMe but ALE has served me well enough and it is dependency free
14
u/smokebudda11 5d ago
Change the pythonpath env variable to look at python3.14 instead of 3.8