title: uninstall virtualenv in mac
body: <p><a href="https://www.tensorflow.org/versions/r0.12/get_started/os_setup.html#virtualenv-installation" rel="nofollow noreferrer">I try to install tensorflow via virtualenv in mac, the reference is here:</a></p>
  
  <ul>
  <li><p>for I have python already, so I install virtualenv by:
  <code>sudo pip install --upgrade virtualenv</code></p></li>
  <li><p>build a new virtualenv environment in <code>~/development project/tensorflow</code>, not in <code>~/tensorflow</code> as is said in the reference: </p>
  
  <p><code>virtualenv --system-site-packages ~/development project/tensorflow</code></p>
  
  <p><code>cd ~/development project/tensorflow</code></p></li>
  <li><p>active virtualenv by:</p>
  
  <p><code>source bin/activate  # if use bash,and I choose this line to run</code></p></li>
  <li><p>when I am in virtualenv and run this: </p>
  
  <p><code>(tensorflow)$ pip install --upgrade &lt;$url_to_binary.whl&gt;</code></p>
  
  <p>it comes out an error:</p>
  
  <p><code>zsh: parse error near '\n'</code></p></li>
  <li><p><a href="https://stackoverflow.com/questions/33673583/installing-tensorflow-in-a-virtualenv-on-osx">then I check here to help solve it</a>
  it says that <code>&lt;$url_to_binary.whl&gt;</code> should be replaced by <code>https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl</code>, and I do so. And problem gone.</p></li>
  <li><p>but, when I try to test tensorflow by cd some dir in tensorflow like: </p>
  
  <p><code>(tensorflow)$ cd tensorflow/models/image/mnist</code></p>
  
  <p>the dir is not exist.</p>
  
  <p>so I guess the url I modified cause it, and I try to reinstall virtualenv and tensorflow, to make my install clean.</p></li>
  <li><p>tensorflow is successfully uninstalled, but when I remove virtualenv, it booms:</p></li>
  </ul>
  
  <blockquote>
    <p>Exception: Traceback (most recent call last):   File
    "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215,
    in main
        status = self.run(options, args)   File "/usr/local/lib/python2.7/site-packages/pip/commands/uninstall.py",
    line 76, in run
        requirement_set.uninstall(auto_confirm=options.yes)   File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 346,
    in uninstall
        req.uninstall(auto_confirm=auto_confirm)   File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line
    754, in uninstall
        paths_to_remove.remove(auto_confirm)   File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py",
    line 115, in remove
        renames(path, new_path)   File "/usr/local/lib/python2.7/site-packages/pip/utils/<strong>init</strong>.py", line
    267, in renames
        shutil.move(old, new)   File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py",
    line 303, in move
        os.unlink(src) OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/DESCRIPTION.rst'</p>
  </blockquote>
  
  <ul>
  <li>I delete dir <code>tensorflow</code></li>
  <li><p>for now I could not uninstall virtualenv neither install it, but it still exist....that's really wired.</p></li>
  <li><p>If I run <code>sudo pip install --upgrade virtualenv</code> again, it says:</p></li>
  </ul>
  
  <blockquote>
    <p>The directory '/Users/Calvino/Library/Caches/pip/http' or its parent
    directory is not owned by the current user and the cache has been
    disabled. Please check the permissions and owner of that directory. If
    executing pip with sudo, you may want sudo's -H flag.   The directory
    '/Users/Calvino/Library/Caches/pip' or its parent directory is not
    owned by the current user and caching wheels has been disabled. check
    the permissions and owner of that directory. If executing pip with
    sudo, you may want sudo's -H flag.   Requirement already up-to-date:
    virtualenv in /usr/local/lib/python2.7/site-packages</p>
  </blockquote>
  
  <p>My question is that how could I remove virtualenv and tensorflow thoroughly and reinstall them.</p>
  
  <p>I would be very appreciate if anyone could help.</p>