Quick virtualenv fix on Mountain Lion

Overview

It appears that Apple somehow broke Python in Mountain Lion, so even with the latest Command Line Tools and Xcode 4.4 virtualenv won't properly work. During virtual environment creation it will try to install easy_install inside /Library hierarchy. So let's give it a quick workaround. Let's install custom python into your $HOME-directory using pythonbrew!

Installing proper Command Line Tools

Without the Apple Mac Developer account you won't even see the proper download link for the latest CL Tools and the old one won't work on ML. So here's the link: http://goo.gl/iBTXh. It points towards the Apple website so don't worry.

Let's try pythonbrew

Next we will install pythonbrew: curl -kL http://xrl.us/pythonbrewinstall | bash

After that we need to put pythonbrew's bin/ directory before anything else in your $PATH. Add this line to the end of your .bashrc file: [[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc

This comment has been minimized.

Have you tried the developer preview CL tools (Preview 3). They have worked for me and you don't need a Mac OS developer subscription, but you may need a free developer account . Get them here: https://developer.apple.com/downloads/

Have you tried the developer preview CL tools (Preview 3). They have worked for me and you don't need a Mac OS developer subscription, but you may need a free developer account . Get them here: https://developer.apple.com/downloads/

This comment has been minimized.

On Jul 26, 2012 8:07 PM, "James Robert" < ***@***.***> wrote:
Finally got this working by installing the Command line tools via xcode:
You need to install Xcode 4.4 (from the app store) and then, within xcode
open `Xcode > Preferences` (or press `Cmd` + `,`) then open the `downloads`
tab and install the `Command Line Tools`.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/3179227

On Jul 26, 2012 8:07 PM, "James Robert" < ***@***.***> wrote:
Finally got this working by installing the Command line tools via xcode:
You need to install Xcode 4.4 (from the app store) and then, within xcode
open `Xcode > Preferences` (or press `Cmd` + `,`) then open the `downloads`
tab and install the `Command Line Tools`.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/3179227

This comment has been minimized.

@thesharp I had the same issue with it saying it was only for 10.7. If you upgrade to xcode 4.4 and download from the download preference pane, it downloads successfully. Unfortunately, my python environment is still pretty messed up.

@thesharp I had the same issue with it saying it was only for 10.7. If you upgrade to xcode 4.4 and download from the download preference pane, it downloads successfully. Unfortunately, my python environment is still pretty messed up.

This comment has been minimized.

On Jul 26, 2012 8:45 PM, "Adam Gotterer" < ***@***.***> wrote:
@thesharp I had the same issue with it saying it was only for 10.7. If you
upgrade to xcode 4.4 and download from the download preference pane, it
downloads successfully. Unfortunately, my python environment is still
pretty messed up.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/3179227

On Jul 26, 2012 8:45 PM, "Adam Gotterer" < ***@***.***> wrote:
@thesharp I had the same issue with it saying it was only for 10.7. If you
upgrade to xcode 4.4 and download from the download preference pane, it
downloads successfully. Unfortunately, my python environment is still
pretty messed up.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/3179227

This comment has been minimized.

I actually just got everything working. I've seen lots of people complaining about different issues. For me I was having trouble running python specific packages. It seems that mountain lion did something to pip and it's packages. Thankfully I don't have too many of them. I had to sudo easy_install pip (not sure why I needed sudo). Then I used pip to re-install broken packages. Things appear to be working right now.

I actually just got everything working. I've seen lots of people complaining about different issues. For me I was having trouble running python specific packages. It seems that mountain lion did something to pip and it's packages. Thankfully I don't have too many of them. I had to sudo easy_install pip (not sure why I needed sudo). Then I used pip to re-install broken packages. Things appear to be working right now.

This comment has been minimized.

I should point out that installing Mountain Lion wipes your site-packages folder completly so you need to reinstall all of your packages using Pip. Also I found it much easier to destroy all of my virtualenv environments and rebuild them from requirements files.

I should point out that installing Mountain Lion wipes your site-packages folder completly so you need to reinstall all of your packages using Pip. Also I found it much easier to destroy all of my virtualenv environments and rebuild them from requirements files.

This comment has been minimized.

On Jul 26, 2012 8:53 PM, "Adam Gotterer" < ***@***.***> wrote:
I actually just got everything working. I've seen lots of people
complaining about different issues. For me I was having trouble running
python specific packages. It seems that mountain lion did something to pip
and it's packages. Thankfully I don't have too many of them. I had to sudo
easy_install pip (not sure why I needed sudo). Then I used pip to
re-install broken packages. Things appear to be working right now.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/3179227

On Jul 26, 2012 8:53 PM, "Adam Gotterer" < ***@***.***> wrote:
I actually just got everything working. I've seen lots of people
complaining about different issues. For me I was having trouble running
python specific packages. It seems that mountain lion did something to pip
and it's packages. Thankfully I don't have too many of them. I had to sudo
easy_install pip (not sure why I needed sudo). Then I used pip to
re-install broken packages. Things appear to be working right now.
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/3179227

This comment has been minimized.

For those looking for a quick solution - downloading and installing the latest 2.7.x python from python.org solved the problem. Make sure you reboot your machine after the installation is complete, otherwise nothing will work.

For those looking for a quick solution - downloading and installing the latest 2.7.x python from python.org solved the problem. Make sure you reboot your machine after the installation is complete, otherwise nothing will work.