Take the 2-minute tour ×

I'm trying to create a virtualenv with the following command:

$ virtualenv env --distribute

and I am getting the following message:

...Installing pip...done.
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 8, in <module>
    load_entry_point('virtualenv==1.8.2', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 942, in main
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1054, in create_environment
    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 655, in install_pip
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1020, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/nigelra/Thero...blog/venv/bin/python -x /Users/nigelra/Thero...env/bin/easy_install /Library/Python/2.7/...ort/pip-1.2.1.tar.gz failed with error code 2

I'm not particularly adept at reading OSX error messages. Would someone be willing to lend their knowledge to solve this problem?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

For anyone else who gets error code 2 in the future here is how I dealt with it. I never figured out which problem made the fix (there were a lot of problems) but I can outline the steps I took to cleaning up my computer.

  1. I followed this guide to setting up my Python environment "right" http://docs.python-guide.org/en/latest/starting/install/osx/
  2. I encounter a ton of errors when I did $ brew doctor
  3. I laboriously got rid of every warning and error using google as my guide.
  4. Many of the folder permissions had to be changed.

Eventually I was able to set up a virtualenv after a re installation of most everything.

Hope this helps anyone who encounters the same mess I did.

share|improve this answer

Your Answer


