Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacVim crashes with VimBox enabled #23

Open
Robert-M-Muench opened this issue May 29, 2016 · 4 comments
Open

MacVim crashes with VimBox enabled #23

Robert-M-Muench opened this issue May 29, 2016 · 4 comments

Comments

@Robert-M-Muench
Copy link

I have python 3.5 enabled but get this if I try to open a file or run:

:python3 import sys; print(sys.version)

mac-pro:VimBox robby$ mvim
mac-pro:VimBox robby$ Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'

Current thread 0x00007fff7474a000 (most recent call first):
Vim: Caught deadly signal ABRT
Vim: Finished.

@Robert-M-Muench
Copy link
Author

The fix is to add this line to .vimrc when you use MacPorts Python installation.

let $PYTHONHOME="/opt/local/Library/Frameworks/Python.framework/Versions/Current"

Then things work.

@vdeep
Copy link

vdeep commented Aug 24, 2017

I'm having the same issue. I'm using python 3.6 with homebrew. I tried setting the PYTHONHOME path in vimrc.custom.before but still getting the same issue.

@jordwalke
Copy link
Owner

Yeah, I ran into this as well when trying python via brew. I'll reopen this and maybe someone can create a config that will work for all kinds of python installations.

@jordwalke jordwalke reopened this Oct 20, 2017
@motiko
Copy link

motiko commented May 7, 2018

Adding the following code to vimrc.custom.before solved this error for me.

if has('python3')
    command! -nargs=1 Py py3 <args>
    set pythonthreedll=/usr/local/Frameworks/Python.framework/Versions/3.6/Python
    set pythonthreehome=/usr/local/Frameworks/Python.framework/Versions/3.6
else
    command! -nargs=1 Py py <args>
    set pythondll=/usr/local/Frameworks/Python.framework/Versions/2.7/Python
    set pythonhome=/usr/local/Frameworks/Python.framework/Versions/2.7
endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants