0

I uninstalled tensorflow with:

pip uninstall tensorflow

it was successful and when I run it again, I receive this message:

Skipping tensorflow as it is not installed.

The issue is that when I import tensorflow inside python via:

python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
2022-05-27 09:35:22.981575: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found
2022-05-27 09:35:22.981872: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
>>> tensorflow.__version__
'1.15.0'
>>>

Do there is tensorflow installed and I could not uninstall it. How can I uninstall it completely? I want to install tensorflow==1.14 instead of 1.15.

I can install tensorflow==1.14.0 via:

pip install tensorflow==1.14.0

but when I run python, it's using tensorflow==1.15 instead of 1.14.0

CFD
  • 607
  • 1
  • 11
  • 29
  • you also need cuda drivers installed – Dean Van Greunen May 27 '22 at 13:40
  • @DeanVanGreunen I don't want to use tensorflow gpu – CFD May 27 '22 at 13:41
  • May have been installed in multiple places. What does `tensorflow.__path__` show? – Keith May 27 '22 at 13:41
  • @Keith No, it's actually in the same python directory that I am running the code with. – CFD May 27 '22 at 13:42
  • well then it's importing that one. change directories and what do you get? – Keith May 27 '22 at 13:43
  • 3
    it looks like you have multiple pythons installed, and the default pip is probably Python2. Try: `pip3 uninstall tensorflow` or `python -m pip uninstall tensorflow` – Marat May 27 '22 at 13:44
  • @CFD the package is looking for the cuda driver DLLs, thats the issue you are having – Dean Van Greunen May 27 '22 at 13:45
  • install cuda, then try uninstalling the package – Dean Van Greunen May 27 '22 at 13:45
  • @Marat python -m pip uninstall tensorflow worked. Why I am not able to use pip uninstall tensorflow inside python but I am able to run python -m pip uninstall tensorflow? – CFD May 27 '22 at 13:47
  • 2
    @CFD when you have multiple Pythons, it means each of them maintains a separate "database" of installed packages. `pip` refers to only one of these databases, which happens to be different from default Python. `python -m pip ...` is a way to invoke pip for the specific Python you're using, so e.g. if you have 3.7 and 3.8 installed, you could `python3.7 -m pip ...` to manage Python 3.7 packages even if the default pip refers to 3.8 – Marat May 27 '22 at 13:53
  • Thanks @Marat. `Python -m pip ...` solve the question but how about when I install package A with `python -m pip install a` ....it gets installed successfully but when I run `a --help`... it doesn't work. – CFD May 27 '22 at 15:34
  • 1
    @CFD unless `a` is supposed to install a binary of the same name (most of the time), it is not supposed to produce anything. What's the package in question? – Marat May 27 '22 at 18:14
  • @Marat it's Tabulo package: https://github.com/the-black-knight-01/Tabulo – CFD May 27 '22 at 20:13
  • I see tabulo installed in `python -m pip list` but it brings no module found when I `python -m tabulo` or `tabulo --help`. even I set temp alias but it's still not working: `set-alias -name tabulo -value "C:\Users\Documents\tabulo\venv\Scripts\tabulo.exe"` – CFD May 27 '22 at 20:16
  • `python -m ` executes a module. Only modules designed for this support this feature, like `pip` and `simplehttpserver` - but most, including tabulo, don't. What's the intent behind `pip -m tabulo ...`, anyway? – Marat May 27 '22 at 20:48
  • @CFD ok, I see - tabulo is supposed to install a binary. Most likely, the folder it is installed into is not in your `$PATH`. What OS are you using? – Marat May 27 '22 at 20:52

1 Answers1

0

If you run "pip list", do you see TF listed still?

Are you running Python with your code in a VENV? Curious if TensorFlow could be installed in main Python yet removed from VENV (though I saw your response to comment above).

Maybe go into Python's site-packages dir and check if TF package folder exists. If on Windows, maybe Python is installed in your Users directory, this TF the same. It can definitely get confusing.

Other folks mentioned to uninstall using "...-{cpu|gpu}".

I found this SO discussion about similar issue that may help. Link

Please keep us updated on findings.

Ken Stulce
  • 23
  • 1
  • 5