Question

I've been banging my head against a wall trying to get virtualenv on Mac OS X (Snow Leopard) playing nicely with the matplotlib and/or the Enthought Python Distribution, and after following a bunch of different helpful advice I think I've broken my installations past my ability to recover them. I am now at a point where virtualenv no longer works at all; I would appreciate if someone can help me process the following stack trace:

~ $ virtualenv foo
The --no-site-packages flag is deprecated; it is now the default behavior.
Traceback (most recent call last):
File "/Library/Frameworks/EPD64.framework/Versions/Current/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.7', 'console_scripts', 'virtualenv')()
File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/virtualenv.py", line 928, in main
    never_download=options.never_download)
File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/virtualenv.py", line 1029, in create_environment
    site_packages=site_packages, clear=clear))
File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/virtualenv.py", line 1143, in install_python
    mkdir(lib_dir)
File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/virtualenv.py", line 399, in mkdir
    os.makedirs(path)
File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 20] Not a directory: 'foo/lib'
Was it helpful?

Solution

It looks like some of your previous behavior (or general "foo" hacking) has left a foo file in ~ dir.... e.g. I can reproduce the error with:

(phil@ute::~) touch foo
(phil@ute::~) virtualenv foo
" .... same output you saw ending with:"
OSError: [Errno 20] Not a directory: 'foo/lib'

Delete that file (or try virtualenv not_so_foo) and you should be OK.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top