环境管理
查看所有环境
powershell
conda env list创建环境
powershell
conda create -n <环境名> python=<版本号>激活环境
powershell
conda activate <环境名>退出环境
powershell
conda deactivate移除环境
powershell
conda remove -n <环境名> --all复制环境
powershell
conda create -n <新环境名> --clone <原环境名>包管理
搜索包
powershell
# PyPI中,功能疑似被禁用,建议直接使用网页搜索
pip search <包名>查看已经安装的包
powershell
# 列出已安装的包
pip list
# 查看指定包详细信息
pip show <包名>安装包
powershell
# 安装最新版本
pip install <包名>
# 安装指定版本
pip install <包名>==<版本号>
# 安装指定范围的某个版本
pip install <包名>>=<版本号>,<<版本号>
# 从文件批量安装依赖
pip install -r requirements.txt移除包
powershell
pip uninstall <包名>更新包
powershell
pip install --upgrade <包名>
pip install -U <包名>检查包依赖冲突
powershell
pip checkpipi镜像源
powershell
# 单次使用源
pip install <包名> -i https://pypi.tuna.tsinghua.edu.cn/simple
# 永久设置默认源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simpleConda镜像源
powershell
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
conda config --set show_channel_urls yes- 本文链接: https://go.kulve.tech/posts/%E7%AC%94%E8%AE%B0/conda%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4/
- 版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 许可协议。
