10

The following image shows various versions of tensorflow installed however I am not able to uninstall it.

I tried pip, pip3, conda and still it does not recognise tensorflow.

I even tried all the possibilities from this thread Tensorflow: why 'pip uninstall tensorflow' cannot find tensorflow

How to remove Tensorflow completely ?

Bi613
  • 121
  • 1
  • 1
  • 5

7 Answers7

5

Try

pip uninstall tensorflow-cpu

or

pip uninstall tensorflow-gpu
Community
  • 1
  • 1
5

Did you try uninstalling by removing protobuf first and then tensorflow

sudo pip uninstall protobuf
sudo pip uninstall tensorflow

And most probably you didn't installed tensorflow via conda that's why you were getting that error(package not found) To figure out which package was used to install the particular package you can list using the following command

conda list
pip list

. ...etc

And use appropriate command to uninstall the package

Sachin Rajput
  • 238
  • 7
  • 26
2

Try "pip uninstall tensorflow-___" at the place of dashes add CPU or gpu according to the build that you have installed.

1

You can delete any python package that was installed globally, manually by going into your global site-packages folder and deleting the files manually.

pip show tensorflow should give you, dependant on your version of pip the location of tensorflow on your machine.

Usually its /usr/lib/pythonX.X/site-packages where X.X can be substituted with your version of python/pip. The same should work for Windows machines.

You can then uninstall tensorflow bydeleting the folder tensforflow. You most likely will require sudo priveliges.

After you are done, there should be no traces of tensorflow on your machine.

zython
  • 1,176
  • 4
  • 22
  • 50
  • pip show Tensorflow does not give any output and I went and searched however there was no folder site-packages instead there was one dist-packages folder. I searched in all pythonX.X folders there was no Tensorflow mentioned. – Bi613 Jun 29 '18 at 10:07
  • anything else that you can sugggest? – Bi613 Jun 29 '18 at 10:08
  • perhaps you have installed it in your user directory ? – zython Jun 29 '18 at 13:38
  • 1
    not really a good idea to manually mess around with structures maintained by installers (`pip` in this case). – Kashyap Aug 24 '22 at 14:41
1

In case you created virtual environment then activate it.

.\venv\Scripts\activate

notice (venv) before the command prompt.
now...

pip uninstall tensorflow

this worked for me!

1

If the previous answers did not work, try:

python -m pip uninstall tensorflow

directly in Command Prompt (for windows) instead of running the code in jupyter or VS.

if you had installed tensorflow-gpu previously, you should edit above code same as below in the command prompt:

python -m pip uninstall tensorflow-gpu
hamflow
  • 27
  • 6
0

Mine froze while uninstalling (!pip uninstall tensorflow). It was because the cmd tried to prompt whether to untinue "(Y/n) ?". The solution was to type "pip uninstall tensorflow" directly in the cmd and not in the notebook