简体   繁体   English

在python中卸载包

[英]Uninstall packages inside python

I uninstalled tensorflow with:我卸载了 tensorflow:

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 中导入 tensorflow 时:

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.是否安装了tensorflow,我无法卸载它。 How can I uninstall it completely?我怎样才能完全卸载它? I want to install tensorflow==1.14 instead of 1.15.我想安装 tensorflow==1.14 而不是 1.15。

I can install tensorflow==1.14.0 via:我可以通过以下方式安装 tensorflow==1.14.0:

pip install tensorflow==1.14.0

but when I run python, it's using tensorflow==1.15 instead of 1.14.0但是当我运行 python 时,它使用的是 tensorflow==1.15 而不是 1.14.0

If you run "pip list", do you see TF listed still?如果你运行“pip list”,你看到 TF 还在列表中吗?

Are you running Python with your code in a VENV?您是否在 VENV 中使用您的代码运行 Python? Curious if TensorFlow could be installed in main Python yet removed from VENV (though I saw your response to comment above).很好奇 TensorFlow 是否可以安装在主要的 Python 中但从 VENV 中删除(尽管我看到了您对上面评论的回复)。

Maybe go into Python's site-packages dir and check if TF package folder exists.也许进入 Python 的 site-packages 目录并检查 TF 包文件夹是否存在。 If on Windows, maybe Python is installed in your Users directory, this TF the same.如果在 Windows 上,可能 Python 安装在您的 Users 目录中,这个 TF 也一样。 It can definitely get confusing.它肯定会让人感到困惑。

Other folks mentioned to uninstall using "...-{cpu|gpu}".其他人提到使用“...-{cpu|gpu}”进行卸载。

I found this SO discussion about similar issue that may help.我发现这个关于类似问题的讨论可能会有所帮助。 Link 关联

Please keep us updated on findings.请让我们及时了解调查结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM