将Anaconda 安装在个人用户下并设置环境变量
目录
首先,下载Anaconda
https://www.anaconda.com/products/distribution#linux
然后,开始安装Anaconda
In the terminal, run the following:
bash Anaconda3-2022.10-Linux-x86_64.sh
同意安装协议看,同意(yes)
设置安装路径
Anaconda3 will now be installed into this location:
/home/xxx/Tools/anaconda3/2022.10
设置环境变量
Do you wish the installer to initialize Anaconda3 in your .bashrc? [yes or no]
no
我们选用modulefiles来设置环境变量
modulefile名称为2022.10.lua,2022.10.lua文件内容为:
-- Local variables
local base = "/home/xxx/Tools/anaconda3/2022.10"
local version = "2022.10"
local pkgName = "anaconda3"
local pkg = pathJoin(base,"bin")
--Take care of $PATH
prepend_path("PATH",pkg)
-- Setup Modulepath for packages
local mroot = os.getenv("MODULEPATH_ROOT")
local mdir = pathJoin(mroot,pkgName,version)
prepend_path("MODULEPATH",mdir)
调用环境变量
module use /home/xxx/Tools/modulefiles
module load anaconda3/2022.10
这样就可以使用anaconda3/2022.10的jupyter-notebook了。