




















miniconda 使用记录
python多环境搭建使用,在开发python的时候,每个库要求的python版本不一样。
说明文档
https://docs.anaconda.net.cn/miniconda/
卸载本级所有python版本,Launcher保留。

下载安装包
https://docs.anaconda.net.cn/miniconda/install/
https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe

1、3、4 都勾选
1 快捷方式 2 添加环境变量 3默认Python3.13 4.安装后删除临时文件
不添加环境变量,每次都使用conda单独打开命令行窗口,保证python版本安全,我还没试和vscode兼容性,估计得单独开了。

右键名称 在 &Conda 中打开(C) 这样快捷键就是C,右键按C就打开了,这里我用的powershell


使用powershell打开
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy ByPass -NoExit -Command "& 'C:\Users\Reciter\miniconda3\shell\condabin\conda-hook.ps1' ; conda activate 'C:\Users\Reciter\miniconda3'"
使用cmd打开
C:\Users\Reciter\miniconda3\Scripts\activate.bat C:\Users\Reciter\miniconda3\ && cmd.exe /K
注意路径用户名,换成自己的

创建新环境:conda create -n myenv python=3.13
激活环境:conda activate myenv
安装包:conda install numpy pandas
列出所有环境:conda env list
删除环境:conda remove -n myenv --all
(base) PS E:\aiz\cv_unet_image-matting> conda create -n cv_unet_image-matting python=3.13
Do you accept the Terms of Service (ToS) for https://repo.anaconda.com/pkgs/main? [(a)ccept/(r)eject/(v)iew]: a
Do you accept the Terms of Service (ToS) for https://repo.anaconda.com/pkgs/r? [(a)ccept/(r)eject/(v)iew]: a
Do you accept the Terms of Service (ToS) for https://repo.anaconda.com/pkgs/msys2? [(a)ccept/(r)eject/(v)iew]: a
3 channel Terms of Service accepted
Retrieving notices: done
Channels:
- defaults
Platform: win-64
Collecting package metadata (repodata.json): - Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=t
done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 26.3.2
latest version: 26.5.3
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: C:\Users\Reciter\miniconda3\envs\cv_unet_image-matting
added / updated specs:
- python=3.13
The following packages will be downloaded:
package | build
---------------------------|-----------------
bzip2-1.0.8 | h2bbff1b_6 90 KB
ca-certificates-2026.5.14 | haa95532_0 107 KB
libexpat-2.8.2 | hd7fb8db_1 125 KB
libffi-3.4.8 | h42d73b9_3 118 KB
libmpdec-4.0.1 | h1c6eee0_0 93 KB
libzlib-1.3.2 | h1c6eee0_0 63 KB
openssl-3.5.7 | hbb43b14_0 8.9 MB
packaging-26.0 | py313haa95532_0 196 KB
pip-26.1.2 | pyhc872135_0 1.1 MB
python-3.13.14 |h2e1fde4_100_cp313 16.1 MB
python_abi-3.13 | 4_cp313 5 KB
setuptools-82.0.1 | py313haa95532_0 1.6 MB
sqlite-3.53.2 | hee5a0db_0 944 KB
tk-8.6.15 | hf199647_0 3.5 MB
tzdata-2026b | he532380_0 118 KB
ucrt-10.0.22621.0 | haa95532_0 620 KB
vc-14.3 | h2df5915_12 16 KB
vc14_runtime-14.44.35208 | h4927774_12 664 KB
vs2015_runtime-14.44.35208 | ha6b5a95_12 16 KB
wheel-0.47.0 | py313haa95532_0 97 KB
xz-5.8.2 | h53af0af_0 265 KB
zlib-1.3.2 | h1c6eee0_0 828 KB
------------------------------------------------------------
Total: 35.5 MB
The following NEW packages will be INSTALLED:
bzip2 pkgs/main/win-64::bzip2-1.0.8-h2bbff1b_6
ca-certificates pkgs/main/win-64::ca-certificates-2026.5.14-haa95532_0
libexpat pkgs/main/win-64::libexpat-2.8.2-hd7fb8db_1
libffi pkgs/main/win-64::libffi-3.4.8-h42d73b9_3
libmpdec pkgs/main/win-64::libmpdec-4.0.1-h1c6eee0_0
libzlib pkgs/main/win-64::libzlib-1.3.2-h1c6eee0_0
openssl pkgs/main/win-64::openssl-3.5.7-hbb43b14_0
packaging pkgs/main/win-64::packaging-26.0-py313haa95532_0
pip pkgs/main/noarch::pip-26.1.2-pyhc872135_0
python pkgs/main/win-64::python-3.13.14-h2e1fde4_100_cp313
python_abi pkgs/main/win-64::python_abi-3.13-4_cp313
setuptools pkgs/main/win-64::setuptools-82.0.1-py313haa95532_0
sqlite pkgs/main/win-64::sqlite-3.53.2-hee5a0db_0
tk pkgs/main/win-64::tk-8.6.15-hf199647_0
tzdata pkgs/main/noarch::tzdata-2026b-he532380_0
ucrt pkgs/main/win-64::ucrt-10.0.22621.0-haa95532_0
vc pkgs/main/win-64::vc-14.3-h2df5915_12
vc14_runtime pkgs/main/win-64::vc14_runtime-14.44.35208-h4927774_12
vs2015_runtime pkgs/main/win-64::vs2015_runtime-14.44.35208-ha6b5a95_12
wheel pkgs/main/win-64::wheel-0.47.0-py313haa95532_0
done
#
# To activate this environment, use
#
# $ conda activate cv_unet_image-matting
#
# To deactivate an active environment, use
#
# $ conda deactivate
Channel "defaults" has the following notices:
[info] -- Tue Jun 9 00:00:00 2026
PyTorch 2.12 with CUDA support is now available to install with your current channel (Anaconda Main). Learn more: htts
(base) PS E:\aiz\cv_unet_image-matting> conda env list
# conda environments:
#
# * -> active
# + -> frozen
base * C:\Users\Reciter\miniconda3
cv_unet_image-matting C:\Users\Reciter\miniconda3\envs\cv_unet_image-matting
(base) PS E:\aiz\cv_unet_image-matting> conda activate cv_unet_image-matting
(cv_unet_image-matting) PS E:\aiz\cv_unet_image-matting>

创建脚本 condaact.ps1
conda activate cv_unet_image-matting

小计:我脚本名字改成了cc.ps1 因为 目录右键c然后cc回车,特别顺~

# 1. 将虚拟环境路径改到 D 盘
conda config --add envs_dirs E:\CondaConfig\envs
# 2. 将包缓存路径改到 D 盘
conda config --add pkgs_dirs E:\CondaConfig\pkgs
执行后查看,成功了。
(base) PS C:\Users\Reciter\Desktop\ai-dev> conda config --add envs_dirs E:\CondaConfig\envs
(base) PS C:\Users\Reciter\Desktop\ai-dev> conda config --add pkgs_dirs E:\CondaConfig\pkgs
(base) PS C:\Users\Reciter\Desktop\ai-dev> conda info
active environment : base
active env location : C:\Users\Reciter\miniconda3
shell level : 1
user config file : C:\Users\Reciter\.condarc
populated config files : C:\Users\Reciter\miniconda3\.condarc
C:\Users\Reciter\miniconda3\condarc.d\anaconda-auth.yml
C:\Users\Reciter\.condarc
conda version : 26.3.2
conda-build version : not installed
python version : 3.13.13.final.0
solver : libmamba (default)
virtual packages : __archspec=1=skylake
__conda=26.3.2=0
__cuda=12.6=0
__win=10.0.26200=0
base environment : C:\Users\Reciter\miniconda3 (writable)
conda av data dir : C:\Users\Reciter\miniconda3\etc\conda
conda av metadata url : None
channel URLs : https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : E:\CondaConfig\pkgs
envs directories : E:\CondaConfig\envs
C:\Users\Reciter\miniconda3\envs
C:\Users\Reciter\.conda\envs
C:\Users\Reciter\AppData\Local\conda\conda\envs
temporary directory : C:\Users\Reciter\AppData\Local\Temp
platform : win-64
user-agent : conda/26.3.2 requests/2.33.1 CPython/3.13.13 Windows/11 Windows/10.0.26200 solver/libmamba conda-libmamba-solver/26.4.0 libmambapy/2.3.2 aau/0.7.6 c/. s/. e/.
administrator : False
netrc file : None
offline mode : False
清理老数据
(base) PS C:\Users\Reciter\Desktop\ai-dev> conda clean -p -t -y
There are no unused tarball(s) to remove.
There are no unused package(s) to remove.
我刚装的,所有没有老数据。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。