Solving 'virtualenv' install error when building OpenBazaar on OS X

OpenBazaar is an open-source effort to create a distributed, decentralized marketplace that will let people buy and sell things online without any single point of failure or centralized control. It's a fantastic idea and is currently in beta.

I wanted to write briefly about an build error I ran into on OS X Mavericks while building OpenBazaar and provide a solution, in case other people are running into the same issue. The build instructions to build and run OpenBazaar are available at their GitHub repo wiki.

After I ran ./configure.sh, I received an error about mid-way through:

Installing collected packages: virtualenv  
Cleaning up...  
Exception:  
Traceback (most recent call last):

.....(lines omitted for readability).....

IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv.py'

Storing debug log for failure in /Users/soroushjp/Library/Logs/pip.log  

As with a lot of common 'Permission Denied' build errors, I suspected that this was probably an install that needed root privileges to work, ie.

sudo ./configure.sh  

However, that doesn't work, because brew will complain that it doesn't want root privileges, which is smart:

Error: Cowardly refusing to `sudo brew install`  

Looking further into the build wiki, it looks like the 'pip install' steps require sudo. Since ./configure.sh attempts these steps without sudo, missing any of these pip installs throws our error. So to fix this, simply run these install steps separately with sudo:

sudo easy_install pip  
sudo pip install -U pip  
sudo pip install virtualenv  
sudo pip install virtualenvwrapper  

And now we run our config script once more:

./configure.sh

And voila! Hopefully, your install went through successfully this time.

OpenBazaar screenshot

I suspect the contributors at OpenBazaar simply had the pip dependencies already on their test machine and didn't see the error when they ran ./configure.sh. I'll be looking through their ./configure.sh and making a pull request soon to help fix this issue.

If the solution didn't work for you or you're running into other errors, feel free to contact me on Twitter at @soroushjp or email me_AT_soroushjp.com -- I'd love to help!