Macvim: Support Python 3.9 (macOS + Homebrew)

Created on 15 Nov 2020  路  4Comments  路  Source: macvim-dev/macvim

Describe the bug
Homebrew has changed its default python3 to Python 3.9. As such, on my system Macvim cannot find the Python3.8 library and python3 support is nonfunctional.

To Reproduce
Detailed steps to reproduce the behavior:

  1. Run macvim
  2. execute :py3 import os
  3. Macvim error is reported:
E370: Could not load library /usr/local/Frameworks/Python.framework/Versions/3.8/Python
E263: Sorry, this command is disabled, the Python library could not be loaded.

In my shell, the only similar path that exists is for Python 3.9:

> ls /usr/local/Frameworks/Python.framework/Versions/          
3.9@     Current@
> ls /usr/local/Frameworks/Python.framework/Versions/3.9/Python
/usr/local/Frameworks/Python.framework/Versions/3.9/Python*

Expected behavior
Macvim is able to use Python 3.*

Environment (please complete the following information):

  • MacVim version 8.2.1719
  • OS: macOS 10.15.7

Most helpful comment

a temporary workaround is to install [email protected] with homebrew and
create a symbolic link as follows:

> cd /usr/local/Frameworks/Python.framework/Versions/
> ln -sf ../../../Cellar/[email protected]/3.8.6_1/Frameworks/Python.framework/Versions/3.8 3.8
> cd -

best C.

All 4 comments

a temporary workaround is to install [email protected] with homebrew and
create a symbolic link as follows:

> cd /usr/local/Frameworks/Python.framework/Versions/
> ln -sf ../../../Cellar/[email protected]/3.8.6_1/Frameworks/Python.framework/Versions/3.8 3.8
> cd -

best C.

a temporary workaround is to install [email protected] with homebrew and
create a symbolic link as follows:

> cd /usr/local/Frameworks/Python.framework/Versions/
> ln -sf ../../../Cellar/[email protected]/3.8.6_1/Frameworks/Python.framework/Versions/3.8 3.8
> cd -

best C.

Nice, thanks. Small update: latest version on homebrew is 3.8.6_2

CI was already updated to use 3.9 so the next release will look for the correct python libs. For now, you can manually do set pythonthreedll=/usr/local/Frameworks/Python.framework/Versions/3.9/Python to get it to work. If you don't mind waiting a few days, you may want to not add that to your vimrc so you don't forget you added that and be surprised later.

This should be fixed with the new release.

Was this page helpful?
0 / 5 - 0 ratings