如何使用 anaconda conda 命令安装 PyPi 包 [英] How to install PyPi packages using anaconda conda command

查看:109
本文介绍了如何使用 anaconda conda 命令安装 PyPi 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Anacoda Python 发行版时,安装无法直接通过 Anaconda 获得的 PyPi 包的最佳方法是什么?现在我正在使用:

When using the Anacoda Python distribution, what is the best way to install a PyPi package that isn't available directly through Anaconda? For now I'm using:

conda pipbuild [pypi_name]
conda install --use-local [package_spec]

但我不清楚这是否是最好的方法,以及 conda update --all 是否会在更新可用时更新这些包.我也不清楚当 PyPi 已经存在时 binstar 的意义何在.

But I'm unclear if this is the best way and if conda update --all will update these packages when updates are made available. I'm also unclear what the point of binstar is when PyPi already exists.

推荐答案

如果你想为 PyPI 包构建 conda 包,推荐的方式是使用 conda skeleton pypi package 并使用 conda build package 在它创建的配方上.要安装包,请使用 conda install --use-local package(此处和其他地方,package 是您要安装的 PyPI 包的名称).

If you want to build conda packages for PyPI packages, the recommended way is to use conda skeleton pypi package and use conda build package on the recipe that it creates. To install the package, use conda install --use-local package (here and elsewhere, package is the name of the PyPI package you wish to install).

每次更新包时,您都需要更新配方.

You will need to update the recipe each time the package is updated.

您也可以使用 pip 来安装这些包.有两个缺点:首先,这些包根本不会被 conda 管理.其次,如果您的默认 python 版本与您在 conda 中使用的 python 版本不同,这些包将无法工作.

You can also use pip to install these packages. There are two disadvantages: firstly, these packages won't be managed by conda at all. Secondly, these packages will not work if your default python version is different from the python version you are using in conda.

这篇关于如何使用 anaconda conda 命令安装 PyPi 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆