卸载 PyTorch
卸载 PyTorchReferenceshttps://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.mdTo reinstall, first uninstall all existing PyTorch installs. You may need to runpip uninstall torchmultiple times. You’ll knowtorchis fully uninstalled when you seeWARNING: Skipping torch as it is not installed.重新安装 PyTorch 之前请先卸载所有已安装的 PyTorch。您可能需要多次运行pip uninstall torch。当您看到WARNING: Skipping torch as it is not installed时表示torch已完全卸载。You should only have topip uninstalla few times, but you can alwaysuninstallwithtimeoutor in a loop if you’re feeling lazy.你只需要运行几次pip uninstall torch即可但如果你懒得运行也可以使用timeout或循环运行uninstall。pip uninstall torchNext runpython setup.py clean. After that, you can install in editable mode again.接下来运行python setup.py clean。之后你就可以再次以可编辑模式安装。conda uninstall pytorch -y yes | pip uninstall torchUninstall all existing PyTorch installs:conda uninstall pytorch pip uninstall torch pip uninstall torch # run this command twiceyongqiangstrong-sys:~$ pip uninstall torch Uninstalling torch-1.0.0a046ef2b2: Would remove: /usr/local/lib/python2.7/dist-packages/caffe2 /usr/local/lib/python2.7/dist-packages/torch /usr/local/lib/python2.7/dist-packages/torch-1.0.0a046ef2b2.egg-info Proceed (y/n)? y Exception: Traceback (most recent call last): File /usr/local/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py, line 143, in main status self.run(options, args) File /usr/local/lib/python2.7/dist-packages/pip/_internal/commands/uninstall.py, line 75, in run auto_confirmoptions.yes, verboseself.verbosity 0, File /usr/local/lib/python2.7/dist-packages/pip/_internal/req/req_install.py, line 683, in uninstall uninstalled_pathset.remove(auto_confirm, verbose) File /usr/local/lib/python2.7/dist-packages/pip/_internal/req/req_uninstall.py, line 224, in remove renames(path, new_path) File /usr/local/lib/python2.7/dist-packages/pip/_internal/utils/misc.py, line 280, in renames shutil.move(old, new) File /usr/lib/python2.7/shutil.py, line 300, in move rmtree(src) File /usr/lib/python2.7/shutil.py, line 247, in rmtree rmtree(fullname, ignore_errors, onerror) File /usr/lib/python2.7/shutil.py, line 252, in rmtree onerror(os.remove, fullname, sys.exc_info()) File /usr/lib/python2.7/shutil.py, line 250, in rmtree os.remove(fullname) OSError: [Errno 13] 权限不够: /usr/local/lib/python2.7/dist-packages/caffe2/proto/metanet_pb2.py yongqiangstrong-sys:~$ yongqiangstrong-sys:~$ sudo pip uninstall torch [sudo] yongqiang 的密码 The directory /home/yongqiang/.cache/pip/http or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudos -H flag. Uninstalling torch-1.0.0a046ef2b2: Would remove: /usr/local/lib/python2.7/dist-packages/caffe2 /usr/local/lib/python2.7/dist-packages/torch /usr/local/lib/python2.7/dist-packages/torch-1.0.0a046ef2b2.egg-info Proceed (y/n)? y Successfully uninstalled torch-1.0.0a046ef2b2 yongqiangstrong-sys:~$ yongqiangstrong-sys:~$ sudo pip uninstall torch The directory /home/yongqiang/.cache/pip/http or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudos -H flag. Skipping torch as it is not installed. yongqiangstrong-sys:~$ yongqiangstrong-sys:~$ python Python 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609] on linux2 Type help, copyright, credits or license for more information. import torchvision Traceback (most recent call last): File stdin, line 1, in module File /usr/local/lib/python2.7/dist-packages/torchvision/__init__.py, line 1, in module from torchvision import models File /usr/local/lib/python2.7/dist-packages/torchvision/models/__init__.py, line 1, in module from .alexnet import * File /usr/local/lib/python2.7/dist-packages/torchvision/models/alexnet.py, line 1, in module import torch.nn as nn ImportError: No module named torch.nn exit() yongqiangstrong-sys:~$yongqiangfamu-sys:~$ sudo pip uninstall torch yongqiangfamu-sys:~$ sudo pip3 uninstall torchyongqiangfamu-sys:~$ sudo pip uninstall torch DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 wont be maintained after that date. A future version of pip will drop support for Python 2.7. WARNING: The directory /home/yongqiang/.cache/pip/http or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudos -H flag. Uninstalling torch-1.0.1.post2: Would remove: /usr/local/bin/convert-caffe2-to-onnx /usr/local/bin/convert-onnx-to-caffe2 /usr/local/lib/python2.7/dist-packages/caffe2/* /usr/local/lib/python2.7/dist-packages/torch-1.0.1.post2.dist-info/* /usr/local/lib/python2.7/dist-packages/torch/* Proceed (y/n)? y Successfully uninstalled torch-1.0.1.post2 yongqiangfamu-sys:~$ yongqiangfamu-sys:~$ sudo pip3 uninstall torch WARNING: The directory /home/yongqiang/.cache/pip/http or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudos -H flag. Uninstalling torch-1.1.0: Would remove: /usr/local/lib/python3.5/dist-packages/caffe2/* /usr/local/lib/python3.5/dist-packages/torch-1.1.0.dist-info/* /usr/local/lib/python3.5/dist-packages/torch/* Proceed (y/n)? y Successfully uninstalled torch-1.1.0 yongqiangfamu-sys:~$References[1] Yongqiang Cheng (程永强), https://yongqiang.blog.csdn.net/[2] 卸载 PyTorch, https://mp.weixin.qq.com/s/CY6bQ17SXXiprF1Q7EhgYA

相关新闻

输入法词库迁移终极自救指南:深蓝词库转换如何免费搞定 50+ 种格式互通

输入法词库迁移终极自救指南:深蓝词库转换如何免费搞定 50+ 种格式互通

输入法词库迁移终极自救指南:深蓝词库转换如何免费搞定 50 种格式互通 【免费下载链接】imewlconverter ”深蓝词库转换“ 一款开源免费的输入法词库转换程序 项目地址: https://gitcode.com/gh_mirrors/im/imewlconverter 你有没有经历过这样的崩溃瞬间&…

2026/10/15 20:09:10 阅读更多 →
三步搞定SketchUp STL导入导出:免费开源插件打通3D打印全流程实战指南

三步搞定SketchUp STL导入导出:免费开源插件打通3D打印全流程实战指南

三步搞定SketchUp STL导入导出:免费开源插件打通3D打印全流程实战指南 【免费下载链接】sketchup-stl A SketchUp Ruby Extension that adds STL (STereoLithography) file format import and export. 项目地址: https://gitcode.com/gh_mirrors/sk/sketchup-stl …

2026/10/14 15:18:31 阅读更多 →
Apifox WebSocket调试:从手动脚本到自动化测试的完整实践

Apifox WebSocket调试:从手动脚本到自动化测试的完整实践

1. 项目概述:为什么我们需要一个强大的WebSocket调试工具?如果你是一名前后端开发,或者经常和实时数据、消息推送、在线协作这类场景打交道,那么WebSocket对你来说肯定不陌生。它不再是那个“听说过但没用过”的协议,而…

2026/10/15 11:00:54 阅读更多 →

最新新闻

算法导论英文原版第三版PDF:从伪代码到红黑树实现与复杂度分析

算法导论英文原版第三版PDF:从伪代码到红黑树实现与复杂度分析

简介:《算法导论》英文原版教材(第三版)PDF,面向计算机专业学生、算法学习者与求职备考人群,用于系统建立算法设计与分析的知识体系。全书共34章,从算法在计算中的角色讲起,依次覆盖插入排序、分…

2026/10/15 20:56:57 阅读更多 →
Win7 64位下USB转串口驱动安装指南:CH340/CP210x/FTDI/PL2303排错全收录

Win7 64位下USB转串口驱动安装指南:CH340/CP210x/FTDI/PL2303排错全收录

简介:这是一份专为 Windows 7 64 位系统准备的 USB 转串口驱动资源,适用于需要通过 USB 接口连接老式串行设备(如工业控制、GPS、调制解调器等)的用户,解决现代电脑缺少物理串口导致设备无法识别的问题。压缩包共含 25…

2026/10/15 20:56:57 阅读更多 →
光伏功率预测系统用户手册V1.0.1实战指南:数据链路、模型调优与考核避坑

光伏功率预测系统用户手册V1.0.1实战指南:数据链路、模型调优与考核避坑

简介:这份《国能日新光伏功率预测系统用户使用手册V1.0.1》面向光伏电站运维人员、电力调度从业者及新能源相关专业学习者,系统讲解北京国能日新光伏电场功率预报管理系统的操作与配置方法。手册围绕人机界面、接口与数据库三部分展开,涵盖用…

2026/10/15 20:56:57 阅读更多 →
Erupt 对接 Elasticsearch 数据源全解析:注解驱动索引绑定、查询下推与完整 CRUD 实现

Erupt 对接 Elasticsearch 数据源全解析:注解驱动索引绑定、查询下推与完整 CRUD 实现

后端低代码AI 应用人工智能AI Agent认证鉴权RAG 【免费下载链接】erupt 🚀 通用数据管理框架,VORM 对象视图模型,注解驱动低代码开发 项目地址: https://gitcode.com/erupts/erupt 点击查看 免费下载 erupt-data-es 是 Erupt 通用…

2026/10/15 20:56:57 阅读更多 →
从零构建VST 3插件:CMake工程、参数管理与避坑实战

从零构建VST 3插件:CMake工程、参数管理与避坑实战

简介:这是一份VST 3插件开发SDK资源包,面向音频插件开发者、音乐软件工程师及具备一定C基础的学习者,帮助其在Windows、macOS、Linux和iOS平台上构建音效、乐器和音频处理工具。SDK遵循VST 3模块化架构,插件与宿主经由音频处理器、…

2026/10/15 20:56:57 阅读更多 →
NDIS小端口驱动开发实战:从Miniport注册到NBL收发路径详解

NDIS小端口驱动开发实战:从Miniport注册到NBL收发路径详解

简介:这是一份面向Windows内核网络驱动开发者的NDIS 6.0小端口驱动实例源码,针对Realtek 8111/8168/8169/8110等PCI千兆以太网控制器编写。由于DDK中可参考的miniport示例仅有E100BEX,学习NDIS 6.0网卡驱动的资料相当稀缺,本资源正…

2026/10/15 20:55:56 阅读更多 →

日新闻

Docker Compose 容器化部署 ChirpStack LoRaWAN 网络服务器实战

Docker Compose 容器化部署 ChirpStack LoRaWAN 网络服务器实战

1. 为什么选择容器化方式部署 LoRa 网络服务LoRa 物联网项目落地时,网络服务器是整个链路的核心枢纽。它负责接收网关上报的数据包、完成去重与解密、再把有效载荷分发给上层应用。早期大家习惯把网络服务器直接装在物理机上,依赖一堆系统库和特定版本的…

2026/10/15 0:00:46 阅读更多 →
共享LLM服务下的跨模型自动扩缩容:Kubernetes实战与避坑指南

共享LLM服务下的跨模型自动扩缩容:Kubernetes实战与避坑指南

1. 共享推理服务里,扩缩容到底难在哪做过大模型推理服务部署的人,大概都经历过这样的场景:一个团队共用一套推理集群,A 业务跑的是 7B 的小模型,B 业务跑的是 72B 的大模型,C 业务白天流量高、晚上几乎归零…

2026/10/15 0:00:46 阅读更多 →
Systemd 启动阶段根文件系统只读之谜:fstab 与 remount-fs 服务深度解析

Systemd 启动阶段根文件系统只读之谜:fstab 与 remount-fs 服务深度解析

1. 引子:一次内核恐慌引发的追查先从一个真实场景说起。某次我给一台老旧的嵌入式设备折腾系统裁减,为了把启动时间压进两秒以内,我手贱地把一串自认为“没用”的 systemd 服务给 disable 了,其中就包括systemd-remount-fs.servic…

2026/10/15 0:00:46 阅读更多 →

周新闻

流感时间序列预测实战:ARIMA/LSTM全流程拆解与避坑指南

流感时间序列预测实战:ARIMA/LSTM全流程拆解与避坑指南

简介:基于 ARIMA、LSTM、Transformer 等模型的流感时间序列预测 Python 源码,面向计算机相关专业课程设计与期末大作业学生,以及项目实战学习者。内容覆盖预处理、平稳性检验、定阶、残差分析、多模型对比预测的完整时序建模流程,…

2026/10/15 16:18:54 阅读更多 →
影刀RPA新手教程:键盘模拟输入实战——输入文本与模拟按键的区别

影刀RPA新手教程:键盘模拟输入实战——输入文本与模拟按键的区别

影刀RPA新手教程:键盘模拟输入实战——输入文本与模拟按键的区别 做影刀RPA自动化,十个新手有八个栽在"往输入框里填东西"这件事上:要么填不进去,要么填了一半,要么直接把原来内容追加在后面。这背后的根因&…

2026/10/15 19:41:51 阅读更多 →
影刀RPA新手教程:阅文起点小说数据采集实战——书籍信息与章节内容

影刀RPA新手教程:阅文起点小说数据采集实战——书籍信息与章节内容

影刀RPA新手教程:阅文起点小说数据采集实战——书籍信息与章节内容 1. 认识影刀:什么场景该用RPA采小说数据 起点中文网的页面结构相对稳定——分类榜单、书籍详情、章节内容三块独立页面,跳转链路清晰。这种场景非常适合影刀自动化&#x…

2026/10/15 13:48:15 阅读更多 →

月新闻

我发现了一个新思路:用 Remotion + Claude Code 像写代码一样自动化生成短视频

我发现了一个新思路:用 Remotion + Claude Code 像写代码一样自动化生成短视频

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/15 0:14:36 阅读更多 →
Windows下 Codex 中 Chrome 和 Computer Use 插件不可用问题排查及解决参考方式:TaoToken 统一 Key 配置与验证

Windows下 Codex 中 Chrome 和 Computer Use 插件不可用问题排查及解决参考方式:TaoToken 统一 Key 配置与验证

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/14 22:45:47 阅读更多 →
黑夜航拍船只数据集训练YOLOV5模型全流程解析

黑夜航拍船只数据集训练YOLOV5模型全流程解析

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/15 9:49:14 阅读更多 →