Skip to content

Commit 3398646

Browse files
committed
NEW
1 parent fd6f8c3 commit 3398646

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/mixin/conda修改安装路径.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import sys, os
2+
from textwrap import dedent
3+
4+
# 使用方法
5+
# 1. 右键终端以管理员模式运行
6+
# 2. base环境下 :python 此文件路径
7+
# 3. 打开conda文件夹,修改envs和pkgs(这个如果没有就建立)的用户权限全给了
8+
9+
text = dedent(f"""
10+
channels:
11+
- defaults
12+
show_channel_urls: true
13+
default_channels:
14+
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
15+
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
16+
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
17+
custom_channels:
18+
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
19+
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
20+
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
21+
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
22+
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
23+
pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
24+
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
25+
envs_dirs:
26+
- {sys.prefix}/envs
27+
pkgs_dirs:
28+
- {sys.prefix}/pkgs
29+
""")
30+
31+
with open(f'{os.path.expanduser("~")}/.condarc2', 'w', encoding='u8') as f:
32+
f.write(text)
33+
34+
print('Successfully!')

0 commit comments

Comments
 (0)