4

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'
daltonb
  • 635
  • 8
  • 26

1 Answers1

5

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.

Phil Cooper
  • 5,747
  • 1
  • 25
  • 41
  • 1
    yeah i figured that out shortly after posting this.. lol. kind of a waste of a bounty. oh well. thanks – daltonb Feb 19 '12 at 22:50
  • a tip-o-the hat for still awarding bounty. Hopefully a couple of the upvotes let's you know you weren't alone. We've all been there ;-) – Phil Cooper Feb 19 '12 at 22:55