Did you just do your weekly or monthly
brew update && brew upgrade commands and now you're getting Python ImportErrors (something like:
ImportError: cannot import name MAXREPEAT)?
You're not alone, it's frustrating, and it breaks Vim and pretty much everything that uses Python.
Unfortunately Python 2.7.4 introduced some breaking changes. No worries though, I wasted time looking for the answers on how to fix it, so, let's do this.
I can happily say that it is safe to upgrade to 2.7.5. I'd say that YMMV because of the chatter going on over here on the homebrew github issues page, but I've had success with the upgrade thus far. (Weechat and Vim both have behaved as they should).
So it turns out that the maintainer of the Python 2.x formulae is on it and has a fix in the pipeline. Will update this post again once an update to this formulae is final and readily available via brew. I've gone ahead and changed the steps below to just apply the patched version of 2.7.4.
brew unlink python brew remove python brew unlink vim brew remove -force vim
cd `brew --prefix` #should put you in /usr/local git checkout 70e9252bd1c17a874631e030ad009b510cd72d54 Library/Formula/python.rb brew install python #it will install a patched version of 2.7.4
brew install -v -force vim
Forth (for good measure):
That should do the trick. This got everything running again real nice like.
Big up to the following:
Hope this helps others that don't want to waste time troubleshooting this detremental issue.