Как удалить tensorflow windows

Как удалить tensorflow windows

804 просмотра

2 ответа

Я допускаю глупую ошибку и установил неверную версию Tensorflow (я использую windows, но установил версию mac). Как удалить неправильную версию? Также я узнал, что Tensorflow может быть установлен только в версии Python 3.5 (у меня 3.6), это правда? Как понизить мой Python без потери всех библиотек?

Источник Размещён: 06.10.2019 11:20

Ответы (2)

0 плюса

Чтобы удалить tenorflow просто используйте эту команду:

TensorFlow с Python3.6

Это должно работать, потому что билет https://github.com/tensorflow/tensorflow/issues/6533 закрыт. Вам просто нужно установить tenorflow еще раз, и он должен работать под python3.6:

Если нет, используйте следующие инструкции:

«Понизить» до python3.5

Вы не можете просто изменить версию Python, потому что некоторые библиотеки могут быть несовместимы с Python3.5. Вы должны сохранить текущие версии библиотек в файле, используя эту команду:

Установка Python3.5

Если у вас есть только python3.6 и вы хотите легко установить python3.5, вы можете использовать pyenv ( https://github.com/pyenv/pyenv ) и создать virtualenv с python3.5 с помощью инструкций из учебника по pyenv.

Установка библиотек из python3.6

Убедитесь, что ваш virtualenv с python3.5 активирован. Вы должны иметь имя этого virtualenv, видимого в командной строке bash. Убедитесь, что ваша версия Python 3.5 с помощью этой команды:

После этого вы можете установить библиотеки из вашего python3.6 с помощью этой команды:

Если установка не удалась:

Невозможно удалить Tensorflow 2.1.0, так как conda не может найти пакет и решение среды не удается

Пакет tensorflow 2.1.0 показан в разделе conda list следующим образом:

Но когда я пытаюсь удалить его с помощью conda remove tensorflow , я получаю следующее сообщение:

pip uninstall тоже не работает. Я также пробовал несколько других методов (показано ниже) , но ни один из них не помог. Это имеет смысл, поскольку pip list не показывает этот пакет.

Дополнительная информация, что тоже самое странное. Так навигатор anaconda показывает пакет.

Поскольку в списке нет других пакетов с именем tensorflow, я предположил, что этот пакет, отмеченный красным, должен быть тем же пакетом tensorflow, который появляется в conda list .

Пожалуйста, помогите мне удалить этот оставшийся пакет, чтобы я мог выполнить чистую переустановку последних пакетов tenorflow.

1 ответ

Сначала получите путь, по которому ваши пакеты установлены в anaconda-spyder, используя эту команду. См. эту ссылку для получения дополнительной информации.

Затем я смог найти пакет, который был указан на последнем изображении вопроса. Итак, после этого нужно было удалить те папки, которые показаны ниже.

После этого у conda list больше нет этого пакета.

How to uninstall wrong Tensorflow version?

I commit a silly mistake and installed the wrong version of Tensorflow (I’m using windows but installed the mac version). How do I uninstall the wrong version? Also I found out that Tensorflow can only be installed in the Python 3.5 version(mine is 3.6), is that true? How to downgrade my Python without losing all libraries?

Читайте также:  Steam проблемы с запуском windows

2 Answers 2

To uninstall tensorflow just use this command:

TensorFlow with Python3.6

It should work because ticket https://github.com/tensorflow/tensorflow/issues/6533 is closed. You just need to install tensorflow once again and it should work under python3.6:

If not use the following instructions:

«Downgrade» to python3.5

You can’t just change python version, because some libraries can be incompatible with python3.5. You should save current libraries versions in file using this command:

Python3.5 installation

If you have only python3.6 and want to install python3.5 easily you can use pyenv (https://github.com/pyenv/pyenv) and create virtualenv with python3.5 using instructions from pyenv tutorial.

Installing libraries from python3.6

Make sure that your virtualenv with python3.5 is activated. You should have name of this virtualenv visible in bash prompt. Make sure that your python version is 3.5 using this command:

After that you can install libraries from your python3.6 using this command:

uninstall tensorflow from windows #8785

Comments

ghost commented Mar 28, 2017

Hello,
I installed python and tensorflow in windows 10. How can I uninstall it?

Thanks in advance

The text was updated successfully, but these errors were encountered:

Carmezim commented Mar 28, 2017

Hi @ymakkapa, pip uninstall tensorflow will do it if you installed through pip .

ghost commented Mar 28, 2017

Hi @Carmezim , I did as you said. It processed for a while and I got the following errors

Carmezim commented Mar 28, 2017 •

Can you show what you did before please? I need all the steps you took to install and now as well to uninstall TF and also if is TensorFlow with or without GPU support.
Also, upgrade pip as the warning message suggests.

ghost commented Mar 28, 2017

I cannot show as I closed that window. I installed it with pip and without GPU.

Carmezim commented Mar 28, 2017

Can you reproduce it and share the steps?

ghost commented Mar 28, 2017

Hi, running the same line again gives the following output. I think tensorflow is uninstalled
C:\WINDOWS\system32>pip uninstall tensorflow
Cannot uninstall requirement tensorflow, not installed
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the ‘python -m pip install —upgrade pip’ command.

Carmezim commented Mar 28, 2017

It is uninstalled. If you don’t have any other questions, the issue can be closed now otherwise feel free to ask.
Thank you for opening the issue and bearing with me.

sewnet commented Dec 1, 2017

I have a similar issue. I have installed tensorflow GPU version successfully.
But when I try to import tensorflow in a python program, I get a similar error.
I then uninstalled the GPU version, keeping only the CPU version.

Then, import tensorflow, works fine for me.
But I need to work on the GPU version. Help me solve the problem. Please!!

nauman-akram commented Apr 29, 2018

I too have same issue, as I install tensflow-gpu 1.8.0 using pip but when I uninstall it and it does not.

nauman-akram commented Apr 29, 2018

I did » pip uninstall tensorflow-gpu » and » pip uninstall tensorflow-gpu==1.8.0 «, this happens

mangozy commented Jun 14, 2018

Same thing happened to me too!

maxamante commented Jun 26, 2018

@fzr2009 @mangozy @anyoneelse I ran into this issue recently. I was able to fix it by allowing longer filenames in Python.

STRATZ-Ken commented Jul 12, 2018

Had same issue today. Python 3.6. Tensorflow GPU 1.9.0. Cant uninstall, same

FileNotFoundError: [Errno 2] No such file or directory: ‘C:\\Users\\xxx\\AppData\\Local\\Temp\\pip-uninstall-tmnfhchs\\users\\xxx\\appdata\\local\\programs\\python\\python36\\lib\\site-packages\\tensorflow\\include\\tensorflow\\include\\external\\eigen_archive\\unsupported\\eigen\\cxx11\\src\\tensor\\tensorsyclconverttodeviceexpression.h’

Читайте также:  Какие есть операционные системы линукс

fzqneo commented Aug 2, 2018 •

Why was this closed? Is it fixed?

I followed the instructions at https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/cmake to compile tensorflow with GPU from source on Windows 10 using CMake. The I install the generated .whl file using pip .

Then I try to uninstall the fresh installed TF with pip uninstall tensorflow-gpu . Error was:

Exception:
Traceback (most recent call last):
File «C:\Users\t-zifeng\AppData\Local\Continuum\anaconda3\envs\tf1.8-src\lib\shutil.py», line 544, in move
os.rename(src, real_dst)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ‘c:\users\t-zifeng\appdata\local\continuum\anaconda3\envs\tf1.8-src\lib\site-packages\tensorflow\contrib\tensor_forest\hybrid\python\models\pycache\stochastic_hard_decisions_to_data_then_nn.cpython-35.pyc’ -> ‘C:\Users\t-zifeng\AppData\Local\Temp\pip-uninstall-jfv6m05f\users\t-zifeng\appdata\local\continuum\anaconda3\envs\tf1.8-src\lib\site-packages\tensorflow\contrib\tensor_forest\hybrid\python\models\pycache\stochastic_hard_decisions_to_data_then_nn.cpython-35.pyc’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File «C:\Users\t-zifeng\AppData\Local\Continuum\anaconda3\envs\tf1.8-src\lib\site-packages\pip_internal\basecommand.py», line 228, in main
status = self.run(options, args)
File «C:\Users\t-zifeng\AppData\Local\Continuum\anaconda3\envs\tf1.8-src\lib\site-packages\pip_internal\commands\uninstall.py», line 68, in run
auto_confirm=options.yes, verbose=self.verbosity > 0,
File «C:\Users\t-zifeng\AppData\Local\Continuum\anaconda3\envs\tf1.8-src\lib\site-packages\pip_internal\req\req_install.py», line 661, in uninstall
uninstalled_pathset.remove(auto_confirm, verbose)
File «C:\Users\t-zifeng\AppData\Local\Continuum\anaconda3\envs\tf1.8-src\lib\site-packages\pip_internal\req\req_uninstall.py», line 219, in remove
renames(path, new_path)
File «C:\Users\t-zifeng\AppData\Local\Continuum\anaconda3\envs\tf1.8-src\lib\site-packages\pip_internal\utils\misc.py», line 273, in renames
shutil.move(old, new)
File «C:\Users\t-zifeng\AppData\Local\Continuum\anaconda3\envs\tf1.8-src\lib\shutil.py», line 558, in move
copy_function(src, real_dst)
File «C:\Users\t-zifeng\AppData\Local\Continuum\anaconda3\envs\tf1.8-src\lib\shutil.py», line 257, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File «C:\Users\t-zifeng\AppData\Local\Continuum\anaconda3\envs\tf1.8-src\lib\shutil.py», line 121, in copyfile
with open(dst, ‘wb’) as fdst:
FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Users\t-zifeng\AppData\Local\Temp\pip-uninstall-jfv6m05f\users\t-zifeng\appdata\local\continuum\anaconda3\envs\tf1.8-src\lib\site-packages\tensorflow\contrib\tensor_forest\hybrid\python\models\pycache\stochastic_hard_decisions_to_data_then_nn.cpython-35.pyc’

I tried @maxamante ‘s suggestion about enabling longer filenames but it didn’t help.

ababushk commented Aug 13, 2018

pip uninstall tensorflow on Windows fails with the same error on my machines. There is no reason to close this issue.

harry67yqh commented Aug 29, 2018

@maxamante ‘s solution works well. The install directory of tensorflow does have a path which is too long.

Umar-Ayub commented Aug 30, 2018

This issue should not be closed. I have the same error and I tried @maxamante solution on two different Windows systems and it doesn’t change anything for me. Below is the traceback I got. Please help:

Exception:
Traceback (most recent call last):
File «C:\Users\ua12\AppData\Local\conda\conda\envs\DLCdependencies\lib\shutil.py», line 544, in move
os.rename(src, real_dst)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ‘c:\users\ua12\appdata\local\conda\conda\envs\dlcdependencies\lib\site-packages\tensorflow\include\tensorflow\include\external\eigen_archive\unsupported\eigen\cxx11\src\tensor\tensorsyclconverttodeviceexpression.h’ -> ‘C:\Users\ua12\AppData\Local\Temp\pip-uninstall-n6zjpcds\users\ua12\appdata\local\conda\conda\envs\dlcdependencies\lib\site-packages\tensorflow\include\tensorflow\include\external\eigen_archive\unsupported\eigen\cxx11\src\tensor\tensorsyclconverttodeviceexpression.h’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File «C:\Users\ua12\AppData\Local\conda\conda\envs\DLCdependencies\lib\site-packages\pip_internal\basecommand.py», line 228, in main
status = self.run(options, args)
File «C:\Users\ua12\AppData\Local\conda\conda\envs\DLCdependencies\lib\site-packages\pip_internal\commands\uninstall.py», line 68, in run
auto_confirm=options.yes, verbose=self.verbosity > 0,
File «C:\Users\ua12\AppData\Local\conda\conda\envs\DLCdependencies\lib\site-packages\pip_internal\req\req_install.py», line 661, in uninstall
uninstalled_pathset.remove(auto_confirm, verbose)
File «C:\Users\ua12\AppData\Local\conda\conda\envs\DLCdependencies\lib\site-packages\pip_internal\req\req_uninstall.py», line 219, in remove
renames(path, new_path)
File «C:\Users\ua12\AppData\Local\conda\conda\envs\DLCdependencies\lib\site-packages\pip_internal\utils\misc.py», line 273, in renames
shutil.move(old, new)
File «C:\Users\ua12\AppData\Local\conda\conda\envs\DLCdependencies\lib\shutil.py», line 558, in move
copy_function(src, real_dst)
File «C:\Users\ua12\AppData\Local\conda\conda\envs\DLCdependencies\lib\shutil.py», line 257, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File «C:\Users\ua12\AppData\Local\conda\conda\envs\DLCdependencies\lib\shutil.py», line 121, in copyfile
with open(dst, ‘wb’) as fdst:
FileNotFoundError: [Errno 2] No such file or directory: ‘C:\Users\ua12\AppData\Local\Temp\pip-uninstall-n6zjpcds\users\ua12\appdata\local\conda\conda\envs\dlcdependencies\lib\site-packages\tensorflow\include\tensorflow\include\external\eigen_archive\unsupported\eigen\cxx11\src\tensor\tensorsyclconverttodeviceexpression.h’
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the ‘python -m pip install —upgrade pip’ command.

willSapgreen commented Sep 5, 2018

Please reopen this issue because @maxamante ‘s approach doesn’t resolve the issue,
and I have the same error as @Umar-Ayub does on TensorFlow GPU version 1.10.0
Thank you.

bhumireddyc commented Sep 6, 2018

Does the below mean tensorflow is uninstalled?

conda remove -n tensorflow pip python=3.6
Solving environment: done

==> WARNING: A newer version of conda exists.

maxamante commented Sep 6, 2018 •

@Umar-Ayub @willSapgreen @fzqneo Are you trying to uninstall? Do the files exist even though a FileNotFoundError is raised?

UPDATE: From the errors @Umar-Ayub and @fzqneo posted it looks like you’re using Conda? Here’s an issue that might explain the errors you’re seeing conda/conda#7203

@bhumireddyc does conda list show tensorflow installed?

ddomit commented Sep 14, 2018

I have the same problem!! I already tried the solution mentioned here of enabling long paths but im still getting the same results. Please Help!

Exception:
Traceback (most recent call last):
File «c:\users\daniel domit\appdata\local\conda\conda\envs\robond\lib\shutil.py», line 544, in move
os.rename(src, real_dst)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ‘c:\users\daniel domit\appdata\local\conda\conda\envs\robond\lib\site-packages\tensorflow\include\tensorflow\include\external\eigen_archive\unsupported\eigen\cxx11\src\tensor\tensorcontractionthreadpool.h’ -> ‘C:\Users\DANIEL

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

Читайте также:  Ide netbeans для windows

amanharitsh123 commented Sep 23, 2018

Why the issue is closed? we are still facing this problem

amanharitsh123 commented Sep 23, 2018

I have found a workaround ,
pip show tensorflow-gpu
Open the installed directory as shown by the above output and delete all tensorflow folders there.

mugenop commented Oct 15, 2018

I have found a workaround ,
pip show tensorflow-gpu
Open the installed directory as shown by the above output and delete all tensorflow folders there.

cssaheel commented Nov 14, 2018

just go to C:\Users\USERNAME\AppData\Local\Programs\Python\Python35\Lib\site-packages
and rename the folder of tensorflow to something else. That worked for me!

zhouxf53 commented Jan 14, 2019

Worked for me as well

prabindh commented Mar 22, 2019

Since the issue is really due to long file name, it should be temporarily fixed using the Registry-longfilename setting as mentioned at — conda/conda#7203. This setting can be changed back to 0 after the uninstall to avoid breaking other tools. Worked for me (Conda Py3.7/tf1.13).

RohanKPatil commented Jul 12, 2019

The uninstall worked successfully for me with conda uninstall tensorflow . pip was giving me the same error.

hjnnjh commented Aug 22, 2019

@fzr2009 @mangozy @anyoneelse I ran into this issue recently. I was able to fix it by allowing longer filenames in Python.

Thank you, it’s useful.

Jyothif commented Feb 9, 2020

ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.

Traceback (most recent call last):
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py», line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py», line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py», line 24, in swig_import_helper
_mod = imp.load_module(‘_pywrap_tensorflow_internal’, fp, pathname, description)
File «C:\Users\hello\Anaconda3\lib\imp.py», line 242, in load_module
return load_dynamic(name, filename, file)
File «C:\Users\hello\Anaconda3\lib\imp.py», line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File «C:\Users\hello\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py», line 3326, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File «», line 1, in
import tensorflow
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_init_.py», line 101, in
from tensorflow_core import *
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core_init_.py», line 40, in
from tensorflow.python.tools import module_util as module_util
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_init
.py», line 50, in getattr
module = self.load()
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_init
.py», line 44, in _load
module = importlib.import_module(self.name)
File «C:\Users\hello\Anaconda3\lib\importlib_init
.py», line 127, in import_module
return _bootstrap.gcd_import(name[level:], package, level)
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core\python_init
.py», line 49, in
from tensorflow.python import pywrap_tensorflow
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py», line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py», line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py», line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py», line 24, in swig_import_helper
_mod = imp.load_module(‘_pywrap_tensorflow_internal’, fp, pathname, description)
File «C:\Users\hello\Anaconda3\lib\imp.py», line 242, in load_module
return load_dynamic(name, filename, file)
File «C:\Users\hello\Anaconda3\lib\imp.py», line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

Failed to load the native TensorFlow runtime.

for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File «C:\Users\hello\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py», line 2040, in showtraceback
stb = value.render_traceback()
AttributeError: ‘ImportError’ object has no attribute ‘render_traceback

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py», line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py», line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File «C:\Users\hello\Anaconda3\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py», line 24, in swig_import_helper
_mod = imp.load_module(‘_pywrap_tensorflow_internal’, fp, pathname, description)
File «C:\Users\hello\Anaconda3\lib\imp.py», line 242, in load_module
return load_dynamic(name, filename, file)
File «C:\Users\hello\Anaconda3\lib\imp.py», line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Оцените статью