WSL2的Ubuntu 18.04环境如何设置conda
张小白曾试着在WSL下源码编译Python 3.7.5。但这个太复杂了。
张小白心想,为啥不使用Windows上饱受好评的Anaconda呢?
心动不如行动,就试一试吧。
打开 https://www.anaconda.com/products/individual#Downloads
在Linux的X86 installer右键复制 链接地址:https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
回到前面安装好的XShell终端,wget这个地址:
执行这个shell
bash ./Anaconda3-2021.05-Linux-x86_64.sh
回车继续:
读完License
接受license条款
等待安装。。。
回车结束。
编辑/etc/profile,将conda路径加入PATH
export PATH=/home/ascend/anaconda3/bin:$PATH
source /etc/profile 生效
conda init初始化
重新登陆(这里张小白使用Xshell复制了会话,很方便,是不是?
可见进入conda环境
来建个mindspore 1.3-gpu的python环境吧(我怕不提mindspore的话,这个帖子活不长。。。社会啊。。)
conda create -n mindspore1.3-gpu python=3.7.5
按y继续
按提示conda activate mindspore1.3-gpu 进入conda环境
可见,外面的python是3.8.8,里面的python是 3.7.5.