将Anaconda 安装在个人用户下并设置环境变量

将Anaconda 安装在个人用户下并设置环境变量

目录

首先,下载Anaconda

然后,开始安装Anaconda

我们选用modulefiles来设置环境变量

调用环境变量


首先,下载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

Do you wish to update your shell profile to automatically initialize conda?
This will activate conda on startup and change the command prompt when activated.
If you'd prefer that conda's base environment not be activated on startup,
   run the following command when conda is activated:

conda config --set auto_activate_base false

You can undo this by running `conda init --reverse $SHELL`? [yes|no]
[no] >>>

You have chosen to not have conda modify your shell scripts at all.
To activate conda's base environment in your current shell session:

eval "$(/home/langyang/Tools/ananconda3/2024.02/bin/conda shell.YOUR_SHELL_NAME hook)"

To install conda's shell functions for easier access, first activate, then:

conda init

Thank you for installing Anaconda3!

我们选用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了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值