Question: I recently installed a bunch of dotfiles on my Mac along with some other applications (I changed to iTerm instead of Terminal, and Sublime as my default text editor) but ever since, all my virtual environments have stopped working, although their folders inside .virtualenvs are still there and they give the following error whenever I try to run anything in them:

```
dyld: Library not loaded: @executable_path/../.Python
  Referenced from: /Users/[user]/.virtualenvs/modclass/bin/python
  Reason: image not found
Trace/BPT trap: 5

```

I have removed all the files related to dotfiles and have restored my .bash\_profile to what it was before, but the problem persists. Is there any way to diagnose the problem or solve it in an easy way (e.g. not requiring to create all the virtualenvs all over again)?

Answer: 
This occurred when I updated to Mac OS X Mavericks from Snow Leopard. I had to re-install brew beforehand too. Hopefully you ran the freeze command for your project with pip.

To resolve, you have to update the paths that the virtual environment points to.

* Install a version of python with brew:

`brew install python`

* Re-install virtualenvwrapper.

`pip install --upgrade virtualenvwrapper`

* Removed the old virtual environment:

`rmvirtualenv old_project`

* Create a new virtual environment:

`mkvirtualenv new_project`

* Work on new virtual environment

`workon new_project`

* Use pip to install the requirements for the new project.

`pip install -r requirements.txt`

This should leave the project as it was before.
When you are running into this issue on a freshly created virtualenv, it might be that your python version installed by brew is "unlinked".

You can fix this for example by running: `brew link python@3.8`
(but specify your speficic python version)

You can also run `brew doctor`, it will tell you if you have unlinked stuff and how to fix this.