Skip to content

Instantly share code, notes, and snippets.

@arkottke
Last active January 26, 2023 20:01
Show Gist options
  • Save arkottke/a09138243af53e3547eeb32542411c09 to your computer and use it in GitHub Desktop.
Save arkottke/a09138243af53e3547eeb32542411c09 to your computer and use it in GitHub Desktop.
Vim windows and dynamic python
  1. Download vim x64 from: https://github.com/vim/vim-win32-installer/releases
  2. Check versions of Python with :version inside of vim. For example, look for -DDYNAMIC_PYTHON3_DLL
  3. Download Python 3.## Windows embeddable package (64-bit) from: https://www.python.org/downloads/windows/
  4. (optional) Use conda/mamba to install Python 2.7 as there isn't a embeddable package for Python 2.7
  5. Set paths in vimrc:
    set pythonhome=~/AppData/Local/mambaforge/envs/py2718/
    set pythondll=~/AppData/Local/mambaforge/envs/py2718/python27.dll

    set pythonthreehome=C:/opt/python-3.11.1-embed-amd64/
    set pythonthreedll=C:/opt/python-3.11.1-embed-amd64/python311.dll
  1. Test inside vim with:
    :py print "helloworld"
    :py3 print("helloworld")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment