Anaconda使用conda activate激活环境出错
错误如下:
CommandNotFoundError:Yourshellhasnotbeenproperlyconfiguredtouse'condaactivate'. IfyourshellisBashoraBournevariant,enablecondaforthecurrentuserwith $echo"./home/ubuntu/anaconda3/etc/profile.d/conda.sh">>~/.bashrc or,forallusers,enablecondawith $sudoln-s/home/ubuntu/anaconda3/etc/profile.d/conda.sh/etc/profile.d/conda.sh Theoptionsabovewillpermanentlyenablethe'conda'command,buttheydoNOT putconda'sbase(root)environmentonPATH.Todoso,run $condaactivate inyourterminal,ortoputthebaseenvironmentonPATHpermanently,run $echo"condaactivate">>~/.bashrc Previoustoconda4.4,therecommendedwaytoactivatecondawastomodifyPATHin your~/.bashrcfile.Youshouldmanuallyremovethelinethatlookslike exportPATH="/home/ubuntu/anaconda3/bin:$PATH" ^^^TheabovelineshouldNOLONGERbeinyour~/.bashrcfile!^^^
这是由于conda的激活命令出了问题,解决方法如下:
#激活环境 sourceactivate #退出环境 sourcedeactivate
随后解决问题。
condaactivateyour-env-name原文来自:https://www.py.cn
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容