Rebuilding VirtualEnv or VirtualEnvWrapper – Easy

If you end up changing Python install the virtual environments may not work at first.

More specifically the modules installed with pip won’t work.

code>$pip freeze
dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /Users/mikekilmer/Envs/GLITCH/bin/python
  Reason: image not found
Trace/BPT trap: 5

This post has the easy answer.

Just delete all the links in the directory and remake the virtualenv:


#within the env directory
/Users/mikekilmer/Envs/env1 $find pelican/ -type l
list of all the links
$find pelican/ -type l -delete
#bye links
$cd ../
$mkvirtualenv env1
(env1)macbookpro1:env1 mikekilmer$ pip freeze
dill==0.2.1
gnureadline==6.3.3
ipython==2.1.0
lpthw.web==1.1
nose==1.3.3
wsgiref==0.1.2

Yay.