Tensorflow:为什么 'pip uninstall tensorflow' 找不到 tensorflow [英] Tensorflow: why 'pip uninstall tensorflow' cannot find tensorflow

查看:37
本文介绍了Tensorflow:为什么 'pip uninstall tensorflow' 找不到 tensorflow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ubuntu14.04 上使用 Tensorflow-0.8.我首先从源代码安装 Tensorflow,然后根据 官方教程.当我想使用以下命令卸载 tensorflow 时

sudo pip 卸载 tensorflow

我遇到以下错误:

无法卸载tensorflow".没有找到要卸载的文件

谁能告诉我哪里错了?

供您参考,输出pip show tensorflow

名称:tensorflow版本:0.8.0位置:/home/AIJ/tensorflow/_python_build需要:numpy、6、protobuf、wheel

但我实际上在

找到了另一个 Tensorflow 目录

/usr/local/lib/python2.7/dist-packages/tensorflow

另外,我还有一个关于Python的一般用法的问题.我在我的系统中看到了两个非常相似的目录,即

/usr/lib/python2.7/dist-packages/usr/local/lib/python2.7/dist-packages

谁能告诉我它们之间的区别?我注意到每次使用 sudo pip install 时,包都会安装到 /usr/local/lib/python2.7/dist-packages,可以我改为使用 pip install?

将软件包安装到 /usr/lib/python2.7/dist-packages

非常感谢您的帮助!

解决方案

这可能是因为您没有 使用 pip 安装 Tensorflow,但使用 python setup.py develop 作为你的 link 显示.

如果使用 python setup.py install 安装包,

pip uninstall 可能会失败,因为它们不会留下元数据来确定安装了哪些文件.>

因此,您应该能够使用 develop

cd/home/AIJ/tensorflow/_python_buildpython setup.py develop --uninstall

回答关于在 /usr/lib/python2.7/usr/local 下创建的两个 dist-package 的第二个(有趣的)问题/lib/python2.7 它已经存在 很棒的 Stack Overflow 回答关于这个话题.

PS:Tensorflow 是一个很好的库,你应该考虑不要卸载它:)

I'm using Tensorflow-0.8 on Ubuntu14.04. I first install Tensorflow from sources and then setup Tensorflow for development according to the official tutorial. When I want to uninstall tensorflow using the following command

sudo pip uninstall tensorflow

I encountered the following error:

Can't uninstall 'tensorflow'. No files were found to uninstall

Could anyone tell me where is wrong?

For your reference, the output of pip show tensorflow is

Name: tensorflow
Version: 0.8.0
Location: /home/AIJ/tensorflow/_python_build
Requires: numpy, six, protobuf, wheel

But I actually find another Tensorflow directory at

/usr/local/lib/python2.7/dist-packages/tensorflow

Besides, I also have a question about the general usage of Python. I have seen two quite similar directories in my system, i.e.

/usr/lib/python2.7/dist-packages
/usr/local/lib/python2.7/dist-packages

Could any one tell me the differences between them? I noticed that everytime I use sudo pip install <package>, the package will be installed to /usr/local/lib/python2.7/dist-packages, could I instead install packages into /usr/lib/python2.7/dist-packages using pip install?

Thanks a lot for your help in advance!

解决方案

It could be because you didn't install Tensorflow using pip, but using python setup.py develop instead as your link shows.

pip uninstall is likely to fail if the package is installed using python setup.py install as they do not leave behind metadata to determine what files were installed.

Therefore, you should be able to unistall Tensorflow with the option -u or --unistall of develop

cd /home/AIJ/tensorflow/_python_build
python setup.py develop --uninstall

To answer for the second (interestring) question about the two dist-package created under /usr/lib/python2.7 and /usr/local/lib/python2.7 it exists already a great Stack Overflow answer on the topic.

PS: Tensorflow is a good library, you should consider not uninstall it :)

这篇关于Tensorflow:为什么 'pip uninstall tensorflow' 找不到 tensorflow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆