在 Windows 10 中,anaconda 在 %userprofile% 中创建 .conda 和 .condarc。我想移动它们,这样我就可以在 Windows 下安装一个 Anaconda,在 WSL(Ubuntu)下安装另一个,每个都有其环境和设置。如何在 conda 中移动或设置基目录?
(base) C:\Users\user>conda info
active environment : base
active env location : C:\Users\user\AppData\Local\Continuum\anaconda3
shell level : 1
user config file : C:\Users\user\.condarc
populated config files : C:\Users\user\.condarc
conda version : 4.6.11
conda-build version : 3.17.8
python version : 3.7.3.final.0
base environment : C:\Users\user\AppData\Local\Continuum\anaconda3 (writable)
channel URLs : https://conda.anaconda.org/conda-forge/win-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/win-64
https://repo.anaconda.com/pkgs/free/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:\Users\user\AppData\Local\Continuum\anaconda3\pkgs
C:\Users\user\.conda\pkgs
C:\Users\user\AppData\Local\conda\conda\pkgs
envs directories : C:\Users\user\AppData\Local\Continuum\anaconda3\envs
C:\Users\user\.conda\envs
C:\Users\user\AppData\Local\conda\conda\envs
platform : win-64
user-agent : conda/4.6.11 requests/2.21.0 CPython/3.7.3 Windows/10 Windows/10.0.17763
administrator : False
netrc file : None
offline mode : False
答案1
事实证明,两个 conda 安装(一个在 Windows Subsystem for Linux 下,另一个在 Windows 下)不会发生冲突:
在 WSL bash shell 下:
(base) $ conda info| grep "user config file"
user config file : /home/tams00/.condarc
(base) $
在 Anaconda powershell 上:
(base) PS>conda info | Select-String -Pattern "user config file"
user config file : C:\Users\tams00\.condarc
(base) PS>
尽管我并不是立即就意识到这一点,但 /home/user/ 与 C:\Users\user 不同。
看这发布以了解详情。