【python】【conda】【任务】【管理包】

这篇博客详细介绍了如何使用conda管理Python包,包括搜索、安装、更新、固定版本、安装非conda包、商业包以及查看已安装包和依赖项。还讨论了conda与pip的区别,并提供了安装和移除软件包的示例。
摘要由CSDN通过智能技术生成

目录

Managing packages

管理包

1 Searching for packages

1 搜索包

2 Installing packages

2 安装软件包

3 Installing similar packages

3 安装类似的软件包

4 Installing packages from Anaconda.org

4 从Anaconda.org安装软件包

5 Installing non-conda packages

5 安装非conda软件包

6 Installing commercial packages

6 安装商业软件包

7 Viewing a list of installed packages

7 查看已安装的软件包列表

8 Listing package dependencies

8 列出包依赖项

9 Updating packages 更新包

10 Preventing packages from updating (pinning)防止软件包更新(固定)

11 Adding default packages to new environments automatically自动将默认包添加到新环境

12 Removing packages 删除软件包

Managing packages

管理包

Note 注意

There are many options available for the commands described on this page. For details, see commands.
有许多选项可用于本页所述的命令。有关详细信息,请参见命令。

1 Searching for packages

1 搜索包

Use the terminal for the following steps.
使用终端执行以下步骤。

To see if a specific package, such as SciPy, is available for installation:
要查看特定的软件包(如SciPy)是否可用于安装:

conda search scipy

To see if a specific package, such as SciPy, is available for installation from Anaconda.org:
要查看是否可以从Anaconda.org安装特定的软件包(如SciPy),请执行以下操作:

conda search --override-channels --channel defaults scipy

To see if a specific package, such as iminuit, exists in a specific channel, such as Package repository for mutirri :: Anaconda.org, and is available for installation:
要查看特定的包(如iminuit)是否存在于特定的通道(如http://conda.anaconda.org/mutirri)中,并且可用于安装:

conda search --override-channels --channel http://conda.anaconda.org/mutirri iminuit

2 Installing packages

2 安装软件包

Use the terminal for the following steps.
使用终端执行以下步骤。

To install a specific package such as SciPy into an existing environment "myenv":
要将特定的软件包(如SciPy)安装到现有的环境“myenv”中:

conda install --name myenv scipy

If you do not specify the environment name, which in this example is done by --name myenv, the package installs into the current environment:
如果您不指定环境名称(在本示例中由 --name myenv 完成),则软件包将安装到当前环境中:

conda install scipy

To install a specific version of a package such as SciPy:
要安装特定版本的软件包,如SciPy:

conda install scipy=0.15.0

To install multiple packages at once, such as SciPy and cURL:
一次安装多个软件包,如SciPy和cURL:

conda install scipy curl

Note 注意

It is best to install all packages at once, so that all of the dependencies are installed at the same time.
最好一次安装所有的包,这样所有的依赖项都可以同时安装。

To install multiple packages at once and specify the version of the package:
要同时安装多个软件包并指定软件包的版本,请执行以下操作:

conda install scipy=0.15.0 curl=7.26.0

To install a package for a specific Python version:
要安装特定Python版本的软件包,请执行以下操作:

conda install scipy=0.15.0 curl=7.26.0 -n py34_env

If you want to use a specific Python version, it is best to use an environment with that version. For more information, see Troubleshooting.
如果你想使用特定的Python版本,最好使用该版本的环境。有关详细信息,请参阅故障排除。

3 Installing similar packages

3 安装类似的软件包

Installing packages that have similar filenames and serve similar purposes may return unexpected results. The package last installed will likely determine the outcome, which may be undesirable. If the two packages have different names, or if you're building variants of packages and need to line up other software in the stack, we recommend using Mutex metapackages.
安装具有类似文件名和服务类似目的的软件包可能会返回意外结果。最后安装的软件包可能会决定结果,这可能是不希望的。如果两个包有不同的名称,或者如果你正在构建包的变体,并且需要在堆栈中排列其他软件,我们建议使用Mutex元包。

  • 18
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

资源存储库

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值