title: Problems when installing virtualenvwrapper in macOS
body: <p>I need to install <code>virtualenvwrapper</code> on my macOS Sierra to be able to install <a href="https://www.tensorflow.org/install/install_mac#installing_with_virtualenv" rel="nofollow noreferrer">TensorFlow</a>. Previously I had installed Python 3 based on the instructions <a href="http://python-docs.readthedocs.io/en/latest/starting/install3/osx.html" rel="nofollow noreferrer">here</a> using <code>Homebrew</code>.</p>
  
  <p>Now <code>pip</code> seemed to be nonexistent (<code>pip2</code> and <code>pip3</code> worked though), so I did</p>
  
  <pre><code>sudo easy_install pip
  </code></pre>
  
  <p>Then I followed the instructions given <a href="https://stackoverflow.com/questions/45644224/how-to-install-tensorflow-with-virtualenvwrapper-on-macos-sierra">here</a>, and when I do </p>
  
  <pre><code>source /usr/local/bin/virtualenvwrapper.sh
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>No module named virtualenvwrapper virtualenvwrapper.sh:
  There was a problem running the initialization hooks.
  
  If Python could not import the module virtualenvwrapper.hook_loader,
  check that virtualenvwrapper has been installed for
  VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is set properly.
  </code></pre>
  
  <p>I have tried the solutions given <a href="https://stackoverflow.com/questions/11507186/python-virtualenv-no-module-named-virtualenvwrapper-hook-loader">here</a>, and <a href="https://stackoverflow.com/questions/29486113/problems-with-python-and-virtualenvwrapper-after-updating-no-module-named-virtu?rq=1">here</a>, but no success. I have even tried to install <code>virtualenvwrapper</code> with:</p>
  
  <pre><code>sudo pip2 install --upgrade virtualenvwrapper
  </code></pre>
  
  <p>and</p>
  
  <pre><code>sudo pip3 install --upgrade virtualenvwrapper
  </code></pre>
  
  <p>and still I get the same error. Could someone please help me with this issue?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I have tried to do lazy loading of the <code>virtualenvwrapper</code> like so:</p>
  
  <pre><code>export WORKON_HOME=$HOME/.virtualenvs
  export VIRTUALENVWRAPPER_SCRIPT=/usr/local/bin/virtualenvwrapper.sh
  source /usr/local/bin/virtualenvwrapper_lazy.sh
  </code></pre>
  
  <p>Only then I don't get any errors, and I am able to proceed with installing <code>TensorFlow</code>. But then every time I open a new terminal <code>workon</code> does not work, and I have to do <code>source /usr/local/bin/virtualenvwrapper_lazy.sh</code> every time to be able to use <code>workon</code>. Even when <code>workon</code> is invoked I get a warning/error message as <code>/usr/bin/python: No module named virtualenvwrapper</code>.</p>
  
  <p>Could someone help me see what is going on here?</p>