title: `dyld: Library not loaded` error preventing virtualenv from loading
body: <p>When I tried creating a virtual environment with python using the command <code>virtualenv venv</code> from Terminal, I got the following error: </p>
  
  <pre><code>Using base prefix '/Users/zacharythomas/anaconda3'
  New python executable in /Users/zacharythomas/venv/bin/python
  dyld: Library not loaded: @rpath/libpython3.6m.dylib
  Referenced from: /Users/zacharythomas/venv/bin/python
  Reason: image not found
  ERROR: The executable /Users/zacharythomas/venv/bin/python is not functioning
  ERROR: It thinks sys.prefix is '/Users/zacharythomas' (should be '/Users/zacharythomas/venv')
  ERROR: virtualenv is not compatible with this system or executable
  </code></pre>
  
  <p>I'm not the first person to encounter a similar error -- I tried following <a href="https://stackoverflow.com/a/25947333/3899919">this answer's</a> recommendations and running: </p>
  
  <pre><code>gfind ~/.virtualenvs/my-virtual-env/ -type l -xtype l -delete
  </code></pre>
  
  <p>That didn't help. Nor did running <code>sudo virtualenv venv</code> to run commmand as a super user. </p>
  
  <p>What should I investigate next?</p>