anaconda安装路径默认在D盘,但安装环境的envs路径跑到C盘,修改为D盘

安装的anaconda环境,路径是在anaconda安装目录下的envs中(D:\APPFile\Anaconda3\envs),然而,这次创建的却是在 C:\Users\xxx.conda\envs 中。

首先,找到用户目录下的.condarc文件(C:\Users\username)。修改为这样式儿的:

【没有的话,打开CMD窗口,创建 .condarc 配置文件

python 复制代码
conda config --set show_channel_urls yes

最后一行为环境所在路径,其他复制粘贴

python 复制代码
channels:
  - defaults
show_channel_urls: true
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

envs_dirs: 
  - D:\APPFile\Anaconda\envs

但是当新创建虚拟环境验证时,可能会发现它还是默认安装在C盘用户目录下的envs。

这时候需要修改D:\APPFile\Anaconda的权限:选中Anaconda3文件夹,然后右击选则属性,找到安全Users权限全部允许。接下来确定后,时间稍微有点长,等待完成即可。

【我也尝试了只修改envs文件的权限,但没用,不过可以先尝试一下修改envs文件的权限,不行的话可以改为修改anaconda文件的权限,有点慢且麻烦】

修改anaconda文件的权限时可能出现的问题:修改文件夹权限提示"无法枚举容器中的对象,访问被拒绝

这时新创建一个虚拟环境验证时,发现在D:\APPFile\Anaconda\envs下。

参考:
Anaconda修改环境默认位置
anaconda的envs路径跑到c盘了,修改为D盘

相关推荐
西柚与蓝莓1 小时前
【开源开放体系总结】
python
belldeep5 小时前
python:reportlab 将多个图片合并成一个PDF文件
python·pdf·reportlab
FreakStudio7 小时前
全网最适合入门的面向对象编程教程:56 Python字符串与序列化-正则表达式和re模块应用
python·单片机·嵌入式·面向对象·电子diy
丶21367 小时前
【CUDA】【PyTorch】安装 PyTorch 与 CUDA 11.7 的详细步骤
人工智能·pytorch·python
_.Switch8 小时前
Python Web 应用中的 API 网关集成与优化
开发语言·前端·后端·python·架构·log4j
一个闪现必杀技8 小时前
Python入门--函数
开发语言·python·青少年编程·pycharm
小鹿( ﹡ˆoˆ﹡ )9 小时前
探索IP协议的神秘面纱:Python中的网络通信
python·tcp/ip·php
卷心菜小温9 小时前
【BUG】P-tuningv2微调ChatGLM2-6B时所踩的坑
python·深度学习·语言模型·nlp·bug
陈苏同学9 小时前
4. 将pycharm本地项目同步到(Linux)服务器上——深度学习·科研实践·从0到1
linux·服务器·ide·人工智能·python·深度学习·pycharm
唐家小妹9 小时前
介绍一款开源的 Modern GUI PySide6 / PyQt6的使用
python·pyqt