Conda usage

本文介绍了 Conda 的使用方法,包括确认安装、更新版本、创建新环境、查看当前环境、指定 Python 版本创建环境、切换环境、复制环境、查看已安装软件包,还提及将虚拟环境安装到指定路径及激活指定路径下虚拟环境的命令。
 1 ## **Conda 内容**
 2 
 3 ### 激活 conda 内容
 4 
 5 - 确认 conda 已安装
 6   `conda --version`
 7 
 8 - 更新 conda 版本
 9   `conda update conda`
10 
11 - 创建新环境
12 
13   `conda create --name snowflakes biopython`
14 
15 - 查看当前环境
16 
17   `conda info --envs`
18 
19 - 创建环境时指定 Python 版本
20 
21   `conda create --name bunnies python=3 astroid babel`
22 
23   ```python
24   # 切换环境
25   # Linux, OSX:
26   # source activate snowflakes
27   #
28   # Windows:
29   activate snowflakes
30 
31   # 切换回默认环境(root)
32   # Linux, OSX:
33   # source deactivate
34   #
35   # Windows:
36   deactivate
37 
38   # 复制环境
39   conda create --name flowers --clone snowflakes
40 
41   # 查看所有已安装的软件包
42   conda list
43 
44   #安装虚拟环境到指定路径的命令如下:
45 
46   conda create --prefix=D:\python36\py36 python=3.6
47 
48     # 上面的命令中, 路径D:\python36是先建好的文件夹,py36是需要安装的虚拟环境名称。请注意,安装完成后,虚拟环境的全称包含整个路径,为D:\python36\py36。激活指定路径下的虚拟环境的命令如下
49 
50   ```

 

转载于:https://www.cnblogs.com/zhaxichun/p/10828030.html

C:\Users\RJ>conda usage: conda-script.py [-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. 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 create Create a new conda environment from a list of specified packages. deactivate Deactivate the current active conda environment. doctor Display a health report for your environment. export Export a given environment info Display information about current conda install. init Initialize conda for shell interaction. install Install a list of packages into a specified conda environment. list List installed packages in a conda environment. notices Retrieve latest channel notifications. package Create low-level conda packages. (EXPERIMENTAL) remove (uninstall) Remove a list of packages from a specified conda environment. rename Rename an existing environment. 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. tos A subcommand for viewing, accepting, rejecting, and otherwise interacting with a channel's Terms of Service (ToS). This plugin periodically checks for updated Terms of Service for the active/selected channels. Channels with a Terms of Service will need to be accepted or rejected prior to use. Conda will only allow package installation from channels without a Terms of Service or with an accepted Terms of Service. Attempting to use a channel with a rejected Terms of Service will result in an error. update (upgrade) Update conda packages to the latest compatible version. C:\Users\RJ>activate C:\Users\RJ>conda.bat activate C:\Users\RJ>activate pytorch_gpu C:\Users\RJ>conda activate pytorch_gpu C:\Users\RJ> 这是什么意思,我的conda没法激活吗
04-01
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
(D:\ruanjian\anaconda3) C:\Windows\System32>conda usage: conda [-h] [-V] command ... conda is a tool for managing and deploying applications, environments and packages. Options: positional arguments: command info Display information about current conda install. help Displays a list of available conda commands and their help strings. list List linked packages in a conda environment. search Search for packages and display their information. The input is a Python regular expression. To perform a search with a search string that starts with a -, separate the search from the options with --, like 'conda search -- -h'. A * in the results means that package is installed in the current environment. A . means that package is not installed but is cached in the pkgs directory. create Create a new conda environment from a list of specified packages. install Installs a list of packages into a specified conda environment. update Updates conda packages to the latest compatible version. This command accepts a list of package names and updates them to the latest versions that are compatible with all other packages in the environment. Conda attempts to install the newest versions of the requested packages. To accomplish this, it may update some packages that are already installed, or install additional packages. To prevent existing packages from updating, use the --no-update-deps option. This may force conda to install older versions of the requested packages, and it does not prevent additional dependency packages from being installed. If you wish to skip dependency checking altogether, use the '--force' option. This may result in an environment with incompatible packages, so this option must be used with great caution. upgrade Alias for conda update. See conda update --help. remove Remove a list of packages from a specified conda environment. uninstall Alias for conda remove. See conda remove --help. config Modify configuration values in .condarc. This is modeled after the git config command. Writes to the user .condarc file (C:\Users\60925\.condarc) by default. clean Remove unused packages and caches. package Low-level conda package utility. (EXPERIMENTAL) optional arguments: -h, --help Show this help message and exit. -V, --version Show the conda version number and exit. other commands, such as "conda build", are available when additional conda packages (e.g. conda-build) are installed (D:\ruanjian\anaconda3) C:\Windows\System32>conda update conda Fetching package metadata ..... Solving package specifications: . # All requested packages already installed. # packages in environment at D:\ruanjian\anaconda3: # conda 4.3.30 py36h7e176b0_0 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free (D:\ruanjian\anaconda3) C:\Windows\System32>
06-27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值