Anaconda的重装与卸载(完全清数据的那种),以及更改环境配置

本文详细介绍了如何完全卸载并重装Anaconda,包括为何重装的原因、避免错误的方法、卸载的具体步骤以及如何更改安装路径和环境配置,确保不占用系统盘空间。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、为什么要重装

答:安装时默认放在了系统盘,然后各种安装pks(packages),结果还跑不成功,尤其是使用了jupyter和tensorflow,这不卸载还留着干毛?

二、为什么写这个帖子

答:经验告诉我,这种软件要先搜索一下前辈怎么卸载的,不然很麻烦。但是,我忽略了另一种经验,很多帖子根本就是毒药,气死人不偿命的毒药
具体而言:千万不要直接使用软件所在文件夹自带的uninstall文件!!!!

三、安装(为了删除干净,先重装)

前提:直接使用了软件所在文件夹自带的uninstall文件

重装步骤:我主要有两个改动(因为第一次这么选的)
1、我勾选了 to all users
2、我勾选了 add to system path
(即有两个勾选项的页面)

**检验表明:**重装一遍后,就和第一遍一样,环境配置依然可以读取

四、卸载(毛都不留的卸载)

1、先记下有哪些文件夹:
conda info:查看相关信息

active environment : base
active env location : C:\ProgramData\Anaconda3
shell level : 1
user config file : C:\Users\PBC.condarc【卸载后删除】
populated config files : C:\Users\PBC.condarc
conda version : 4.8.2
conda-build version : 3.18.11
python version : 3.7.6.final.0
virtual packages : __cuda=11.0
base environment : C:\ProgramData\Anaconda3 (read only)
channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\ProgramData\Anaconda3\pkgs
C:\Users\PBC.conda\pkgs【卸载后删除】
C:\Users\PBC\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\PBC.conda\envs
C:\ProgramData\Anaconda3\envs
C:\Users\PBC\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.8.2 requests/2.22.0 CPython/3.7.6 Windows/10 Windows/10.0.18362
administrator : False
netrc file : None
offline mode : False

2、方法:https://blog.csdn.net/kuweicai/article/details/90145242
2.1:进入自己创建的一个环境,安装 Anaconda-Clean package(base环境只读,所以安装不了)。
conda install anaconda-clean
2.2:anaconda-clean --yes
显示结果:
(torch) C:\Users\PBC>anaconda-clean --yes
Backup directory: C:\Users\PBC.anaconda_backup\2020-04-08T033555
这里多了一个备份文件,此时只剩下一个base环境了

3、执行软件所在文件夹自带的uninstall文件

五、再装,更改环境配置,避免占据系统盘

1、换安装路径:https://blog.csdn.net/Ldw_bomber/article/details/88262534
(会有warning,跳过就OK)
2、都勾选(这里第六感)

3、添加镜像、源https://blog.csdn.net/zhayushui/article/details/80433768?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1
https://www.cnblogs.com/hanlulu1998/p/12210589.html

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
#安装时PyTorch,官网给的安装命令需要去掉最后的-c pytorch,才能使用清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
#设置搜索时显示通道地址
conda config --set show_channel_urls yes

conda info:查看是否添加成功

4、更改工作目录、环境目录
4.1、修改jupyter工作目录
https://blog.csdn.net/Chen_Meng_/article/details/80375884?depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-16&utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-16

评论 18
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值