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

查看:442
本文介绍了如何使用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天全站免登陆