0

I installed tensorflow after compiling it with bazel. Now I want to remove it.

My default python is python3.6, but this installation was done on python3.5.

How do I go about uninstalling tensorflow and removing all traces of the bazel installation?

6
  • IIRC you only compile/build it with bazel, the actual installation is with pip.
    – Olorin
    Commented Mar 5, 2019 at 8:15
  • i installed this ages ago, so i do not remember what i did actually. if i try to uninstall with pip, it works for python3.6 which is the default python in the system. but this python3.5 installation remains intact.
    – user590995
    Commented Mar 5, 2019 at 8:17
  • If you can't remember, then provide more details about the installation so we can try and figure out what you did to get here. Where is this python3.5 installation located? How did you get a python3.5 environment?
    – Olorin
    Commented Mar 5, 2019 at 8:19
  • python3.5 is located in /usr/bin/local along with python3.6. i followed the instructions given here: pytorials.com/install-tensorflow141-gpu
    – user590995
    Commented Mar 5, 2019 at 8:22
  • 1
    And those instructions use pip to install tensorflow, like I said. Double check which pip you're using. If you have two installations of Python, maybe you overwrote the pip command from one of them with the other, but you should still be able to do python3.5 -m pip ...
    – Olorin
    Commented Mar 5, 2019 at 8:27

1 Answer 1

0

Bazel is only used for building Tensorflow; the actual installation is done with pip. So you need to uninstall it via pip as well.

If you installed two versions of Python to /usr/local, it's possible that the second installation overwrote the /usr/local/bin/pip command from the first. So you no longer have a pip command for the first version. However, the command is just a wrapper, and you can use Python directly to run the pip module, which functions just like the pip command:

python3.5 -m pip ...

With this you can install/remove packages for that version of Python.

However, for the future, I strongly recommend using virtual environments (via pipenv or anaconda, etc.) instead of installing to /usr/local, for better isolation. Installing to /usr/local also typically requires root, and it's a security risk to run arbitrary scripts downloaded from the internet as root (which is essentially what pip does with setup.py).

You must log in to answer this question.