在Ubuntu上使用Conda
简介
Conda
Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux. Conda quickly installs, runs and updates packages and their dependencies. Conda easily creates, saves, loads and switches between environments on your local computer. It was created for Python programs, but it can package and distribute software for any language.
Anaconda
A downloadable, free, open source, high-performance and optimized Python and R distribution. Anaconda includes conda, conda build, Python and 100+ automatically installed, open source scientific packages and their dependencies that have been tested to work well together, including SciPy, NumPy and many others. Use the
conda install
command to easily install 1,000+ popular open source packages for data science—including advanced and scientific analytics—from the Anaconda repository. Use theconda
command to install thousands more open source packages.
Miniconda
Don’t want the huge collection of 720 software packages? Get Miniconda.
安装
首先下载安装脚本:
|
|
修改权限并运行:
|
|
安装完成后在~/.zshrc
中增加:
|
|
配置
|
|
环境管理
Conda的环境管理功能允许我们同时安装若干不同版本的Python,并自由切换。
创建环境。如果不指定版本,则默认使用安装的py版本:
|
|
查看已安装的环境。当前被激活的环境会有一个*
或者()
标识。
|
|
删除环境:
|
|
激活环境:
|
|
退出环境:
|
|
包管理
与pip类似。以下操作,不使用-n指定环境时操作到当前环境。
安装package
|
|
查看已安装的package
|
|
更新package
|
|
删除package
|
|
查找package信息(不需要也不能指定环境)
|
|
卸载
|
|
删除在.zshrc
中增加的export行。