目录
一、Linux下miniconda安装
1.1、安装
1.2、miniconda初始化
二、Windows下miniconda安装
三、maOS下miniconda安装
3.1、安装
3.2、miniconda初始化
四、参考:
本文给出windows、macos、linux下快速安装miniconda方法。 对比conda,miniconda体积更小。本文给出的终端命令可以实现快速安装最新版miniconda,图形化安装可以参考Installing Miniconda.
一、Linux下miniconda安装
1.1、安装
执行以下明令:
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
如下log信息,可以看到,下载速度很快。
root@DESKTOP-UDK350B:~# wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
--2023-10-29 19:50:35-- https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Resolving repo.anaconda.com (repo.anaconda.com)... 104.16.131.3, 104.16.130.3, 108.162.193.111, ...
Connecting to repo.anaconda.com (repo.anaconda.com)|104.16.131.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 120771089 (115M) [application/x-sh]
Saving to: ‘/root/miniconda3/miniconda.sh’
/root/miniconda3/miniconda.sh 100%[======================================================================================================================================================================>] 115.18M 2.33MB/s in 66s
2023-10-29 19:51:42 (1.74 MB/s) - ‘/root/miniconda3/miniconda.sh’ saved [120771089/120771089]
1.2、miniconda初始化
执行以下明令:
~/miniconda3/bin/conda init bash
~/miniconda3/bin/conda init zsh
这一步安装过程打印信息如下:
root@DESKTOP-UDK350B:~# ~/miniconda3/bin/conda init zsh
no change /root/miniconda3/condabin/conda
no change /root/miniconda3/bin/conda
no change /root/miniconda3/bin/conda-env
no change /root/miniconda3/bin/activate
no change /root/miniconda3/bin/deactivate
no change /root/miniconda3/etc/profile.d/conda.sh
no change /root/miniconda3/etc/fish/conf.d/conda.fish
no change /root/miniconda3/shell/condabin/Conda.psm1
no change /root/miniconda3/shell/condabin/conda-hook.ps1
no change /root/miniconda3/lib/python3.11/site-packages/xontrib/conda.xsh
no change /root/miniconda3/etc/profile.d/conda.csh
modified /root/.zshrc
==> For changes to take effect, close and re-open your current shell. <==
如上信息,后续一定要重新开一个终端才能使用conda,如下,我重新开了一个终端,执行conda指令,是正常的:
二、Windows下miniconda安装
直接执行下面明令:
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -o miniconda.exe
start /wait "" miniconda.exe /S
del miniconda.exe
安装完之后,打开Anaconda Prompt (miniconda3)使用conda,如下图:
三、maOS下miniconda安装
和linux下没啥区别。
3.1、安装
mkdir -p ~/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh -o ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
3.2、miniconda初始化
~/miniconda3/bin/conda init bash
~/miniconda3/bin/conda init zsh
后续一定要重新开一个终端才能使用conda
四、参考:
Miniconda — miniconda documentation