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 分钟前
解决conda下载虚拟环境总是到C盘的问题
conda
袁气满满~_~8 分钟前
Python练习
开发语言·python
我可以将你更新哟10 分钟前
【爬虫】爬取斗罗大陆漫画,面向对象封装(存入数据库)
数据库·爬虫·python
麦麦大数据13 分钟前
F060 基于BERTvue+flask电影评论情感分析系统
后端·python·flask·bert·推荐算法·情感分析·电影评论
yongche_shi14 分钟前
第八十九篇:CAP理论、BASE理论在系统设计中的应用
开发语言·python·面试宝典·cap理论·base理论
小智RE0-走在路上37 分钟前
Python学习笔记(13) --Mysql,Python关联数据库
数据库·python·学习
YJlio39 分钟前
杨利杰YJlio|博客导航目录(专栏总览 + 推荐阅读路线)
开发语言·python·pdf
Swizard39 分钟前
数据不够代码凑?用 Albumentations 让你的 AI 模型“看”得更广,训练快 10 倍!
python·算法·ai·训练
智算菩萨43 分钟前
【Python机器学习】决策树与随机森林:解释性与鲁棒性的平衡
python·决策树·机器学习
宁大小白43 分钟前
pythonstudy Day44
python·机器学习