Remove virtualenv in mac

I am trying to install tensorflow via virtualenv on mac, link is here:

  • I already have python, so I install virtualenv: sudo pip install --upgrade virtualenv

  • create a new virtual environment in ~/development project/tensorflow

    , not in ~/tensorflow

    as the link says:

    virtualenv --system-site-packages ~/development project/tensorflow

    cd ~/development project/tensorflow

  • active virtualenv:

    source bin/activate # if use bash,and I choose this line to run

  • when i am in virtualenv and run this:

    (tensorflow)$ pip install --upgrade <$url_to_binary.whl>

    an error:

    zsh: parse error near '\n'

  • then i check here to help solve the problem it says it <$url_to_binary.whl>

    should be replaced with https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl

    and i do it. And the problem went away.

  • but when i try to check tensorflow on cd, some dir in tensorflow, like:

    (tensorflow)$ cd tensorflow/models/image/mnist

    dir does not exist.

    so I am assuming the url I changed called it and I am trying to reinstall virtualenv and tensorflow to make my installation clean.

  • tensorflow removes successfully, but when I remove virtualenv it fires:

Exception: Traceback (last call last): File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, basically status = self.run (options, args) File " /usr/local/lib/python2.7/site-packages/pip/commands/uninstall.py ", line 76, at run require_set.uninstall (auto_confirm = options.yes) File" / usr / local / lib / python2. 7 / site-packages / pip / req / req_set.py ", line 346, when uninstalling req.uninstall (auto_confirm = auto_confirm) File" /usr/local/lib/python2.7/site-packages/pip/req/req_install .py ", line 754, while deleting paths_to_remove.remove (auto_confirm) File" /usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py ", line 115, remove renames (path, new_path ) The file "/ usr / local / lib / python2.7 / site-packages / pip / utils / init.py ", line 267, when renaming 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 motion os.unlink (src) OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/virtualenv-15.1.0.dist-info/DESCRIPTION .rst '

  • I remove dir tensorflow

  • so far I have not been able to uninstall virtualenv nor install it, but it still exists .... which is actually connected.

  • If I run again sudo pip install --upgrade virtualenv

    it says:

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. Check the permissions and owner of this directory. If doing pip using sudo, you may need the sudo -H flag. The directory '/ Users / Calvino / Library / Caches / pip' or its parent directory is not owned by the current user and caching wheels are disabled. check the permissions and owner of this directory. If running sudo, you may need the sudo -H flag. The requirement has already been updated: virtualenv in / usr / local / lib / python 2.7 / site-packages

My question is how can I completely uninstall virtualenv and tensorflow and reinstall them.

I would really appreciate it if anyone could help.

+3


source to share


2 answers


It's been two years, but anyway you need to uninstall with> // Reinstall Python 2 or 3 with new SO update

brew update
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
brew reinstall python@3

      



Link

then reinstall tensor flow with> https://www.tensorflow.org/install/pip

0


source


Now you just need to run:

 (tensorflow)$ pip install --upgrade tensorflow      # for Python 2.7
 (tensorflow)$ pip3 install --upgrade tensorflow     # for Python 3.n

      

And remove: (this is for virtualenv, you are changing the path, the following path should also be changed to ~ / development / project / tensorflow)

 $ rm -r ~/tensorflow 

      



If you are installing tensorflow using native pip:

$ pip uninstall tensorflow
$ pip3 uninstall tensorflow 

      

More information: https://www.tensorflow.org/install/install_mac

-1


source







All Articles