Issue
I've installed virtualenv
via pip
and get this error after creating a new environment:
selenium:~ auser$ virtualenv new
New python executable in new/bin/python
ERROR: The executable new/bin/python is not functioning
ERROR: It thinks sys.prefix is u'/System/Library/Frameworks/Python.framework/ Versions/2.6' (should be '/Users/user/new')
ERROR: virtualenv is not compatible with this system or executable
In my environment:
PYTHONPATH=/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages
PATH=/System/Library/Frameworks/Python.framework/Versions/2.6/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
How can I repair this?
Thanks.
Solution
If you continue to have trouble with virtualenv
, you might try pythonbrew, instead. It's an alternate solution to the same problem. It works more like Ruby's rvm: It builds and creates an entire instance of Python, under $HOME/.pythonbrew
, and then sets up some bash functions that allow you to switch easily between versions. Where virtualenv
shadows the system version of Python, using symbolic links as part of its solution, pythonbrew
builds entirely self-contained installations of Python.
I used virtualenv
for years. It's a decent solution, but I've switched to pythonbrew
lately. Having completely self-contained Python instances means that installing a new one takes awhile (since pythonbrew
actually compiles Python from scratch), but the self-contained nature of each installation appeals to me. And disk is cheap.
Answered By - Brian Clapper