Conda的使用
conda常用的命令
在Anaconda Powershell Prompt 输入:
1.conda -V
检验是否安装及当前conda的版本。
2.conda list
查看安装了哪些包
3.conda env list
或conda info -e
查看当前存在哪些虚拟环境
4.conda update conda
检查更新当前conda
5.conda create -n env_name python=3.x
Python创建虚拟环境
6.source activate your_env_nam
(Linux)或conda activate your_env_name
(Windows)激活或者切换虚拟环境
7.conda install -n your_env_name [package_name]
在虚拟环境中安装额外的包
Tips: 如果要在命令行用env的pip工具,则在Anaconda Powershell Prompt中cd到pip.exe路径,或者
path/pip install XXX
8.deactivate env_name
关闭虚拟环境(Windows)或source deactivate
(Linux) (即从当前环境退出返回使用PATH环境中的默认python版本) 或者activate root
切回root环境
9.conda remove -n your_env_name --all
删除虚拟环境
10.conda remove --name $your_env_name $package_name
删除环境中的某个包
11.添加镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
Tips:
也可以用阿里镜像源conda config --add channels https://mirrors.aliyun.com/pypi/simple/
和豆瓣镜像源conda config --add channels http://pypi.douban.com/simple/
12.conda config --set show_channel_urls yes
设置搜索时显示通道地址
13.conda config --show channels
显示所有镜像通道路径命令
14.conda config --show channels
显示添加的镜像源:
15.conda config --remove channels 源名称或链接
删除指定的的镜像源:
16、conda config --remove-key channels
恢复默认镜像
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App