Using conda » Managing packages

本文介绍了Conda的基本使用方法,包括如何创建、激活、删除虚拟环境,以及如何搜索、安装、更新Python包。Conda是一款强大的环境和包管理工具,适用于科学计算领域的开发者。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Conda 支持IPython,集成了主要的科学计算python packages,300多MB,适合懒人下载

并且方便做环境管理、package管理


#常用命令


##创建虚拟环境:

conda create --name <环境名字> <安装哪些packages>
比如,创建一个python3的环境,装好 anaconda标准的packages:

conda create -n py35 python=3 anaconda


##切换环境

conda env list

activate <环境名字>

deactivate

conda env export > environment.yml # 导出到文件

conda env create -f environment.yml

##删除环境

conda remove --name flowers --all
## 在不同的python间切换

conda search python
$ conda create -n py27 python=2.7 anaconda

$ conda update python

$ conda install python=3.5
# 管理包 Packages:

conda list -n snowflakes

conda search beautiful-soup

conda install --name bunnies beautiful-soup


Last login: Fri May 30 16:42:01 on ttys004 (base) dr.pan@doctordeMacBook-Air ~ % conda usage: conda [-h] [-v] [--no-plugins] [-V] COMMAND ... conda is a tool for managing and deploying applications, environments and packages. options: -h, --help Show this help message and exit. -v, --verbose Can be used multiple times. Once for detailed output, twice for INFO logging, thrice for DEBUG logging, four times for TRACE logging. --no-plugins Disable all plugins that are not built into conda. -V, --version Show the conda version number and exit. commands: The following built-in and plugins subcommands are available. COMMAND activate Activate a conda environment. build Build conda packages from a conda recipe. clean Remove unused packages and caches. commands List all available conda subcommands (including those from plugins). Generally only used by tab-completion. compare Compare packages between conda environments. config Modify configuration values in .condarc. content-trust Signing and verification tools for Conda convert Convert pure Python packages to other platforms (a.k.a., subdirs). create Create a new conda environment from a list of specified packages. deactivate Deactivate the current active conda environment. debug Debug the build or test phases of conda recipes. develop Install a Python package in 'development mode'. Similar to `pip install --editable`. doctor Display a health report for your environment. export Export a given environment index Update package index metadata files. info Display information about current conda install. init Initialize conda for shell interaction. inspect Tools for inspecting conda packages. install Install a list of packages into a specified conda environment. list List installed packages in a conda environment. metapackage Specialty tool for generating conda metapackage. notices Retrieve latest channel notifications. pack See `conda pack --help`. package Create low-level conda packages. (EXPERIMENTAL) remove (uninstall) Remove a list of packages from a specified conda environment. rename Rename an existing environment. render Expand a conda recipe into a platform-specific recipe. repo See `conda repo --help`. repoquery Advanced search for repodata. run Run an executable in a conda environment. search Search for packages and display associated information using the MatchSpec format. server See `conda server --help`. skeleton Generate boilerplate conda recipes. token See `conda token --help`. update (upgrade) Update conda packages to the latest compatible version. (base) dr.pan@doctordeMacBook-Air ~ % conda env list # conda environments: # base * /opt/anaconda3 (base) dr.pan@doctordeMacBook-Air ~ % conda create -n pytorch python=3.12 CondaValueError: prefix already exists: /opt/anaconda3/envs/pytorch (base) dr.pan@doctordeMacBook-Air ~ % 为什么无法找到名为pytorch的环境
最新发布
05-31
### Conda Globe Package Installation and Usage Conda is an open-source package management system that simplifies the process of installing software packages and managing environments across various operating systems including Windows, macOS, and Linux[^2]. The `globe` package does not appear to be a standard or widely recognized package within the Anaconda distribution or broader Python ecosystem as indicated by available documentation on conda commands and package repositories[^3]. For any typical package installation using conda, one would use the following command structure: ```bash conda install -c channel_name package_name ``` However, since specific information about a `globe` package cannot be found through conventional sources related to conda, it suggests this might either be a custom-built package shared privately among users or teams, or there could have been confusion with another tool or library name. If intending to work with geographical data visualization which may involve terms like 'globe', libraries such as GeoPandas, Basemap toolkit for Matplotlib, Cartopy are more commonly used in conjunction with conda environment setup[^4]. #### Installing Geographical Data Visualization Libraries via Conda To set up an environment suitable for handling geographic datasets along with visualizations resembling globes, consider these examples: ```bash conda create --name geo_env python=3.9 geopandas basemap cartopy matplotlib pandas jupyterlab conda activate geo_env ``` This creates an isolated environment named `geo_env`, ensuring dependencies do not interfere with other projects while providing powerful tools tailored towards spatial analysis tasks involving map projections similar to what one might expect from interacting with globe representations.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值