Python 包安装:pip 与 yum,还是两者兼而有之? [英] Python package installation: pip vs yum, or both together?

查看:44
本文介绍了Python 包安装:pip 与 yum,还是两者兼而有之?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始管理 Hadoop 集群.我们使用 Bright Cluster Manager 达到操作系统级别 (CentOS 7.1),然后使用 Ambari 和 Hortonworks HDP 2.3 for Hadoop.

I've just started administering a Hadoop cluster. We're using Bright Cluster Manager up to the O/S level (CentOS 7.1) and then Ambari together with Hortonworks HDP 2.3 for Hadoop.

我不断收到安装新 Python 模块的请求.我们在安装时使用 yum 安装了一些模块,随着集群的进展,一些模块已使用 pip 安装.

I'm constantly getting requests for new python modules to be installed. Some modules we've installed at setup using yum and as the cluster has progressed some modules have been installed using pip.

执行此操作的正确"方法是什么?总是用yum,却不能提供最新最好的模块?总是使用 pip 而没有一点真理(yum)显示安装了哪些软件包?或者 pip 和 yum 一起使用可以吗?

What is the "right" way to do this? Always use yum and not be able to provide the latest and greatest modules? Always use pip and not have one point of truth (yum) showing which packages are installed? Or is it fine to use both pip and yum together?

我只是担心我在系统中塞满了垃圾和太多版本的 python 模块.有什么建议吗?

I'm just worried that I'm filling the system with junk and too many versions of python modules. Any suggestions?

推荐答案

应该优先选择属于您的发行版的软件包,因为它们已经过测试,可以在您的系统上正常工作.这些软件包在系统范围内安装.

Packages which are part of your distribution should be preferred, because they have been tested to work properly on your system. These packages are installed system-wide.

但是,如果没有提供合适的 RPM 包,请继续并从例如安装它.PyPi 或带有 pip 的 github,但尽可能部署虚拟 Python 环境.使用虚拟环境,您不必在系统范围内安装第三方软件包.您将拥有几组较小的软件包,它们作为一组更易于管理.

However if a suitable RPM package is not provided, go ahead and install it from e.g. PyPi or github with pip, but deploy virtual Python environments whenever possible. With virtual envs you don't have to install third-party packages system-wide. You will have several smaller sets of packages which are much better manageable as one set.

这篇关于Python 包安装:pip 与 yum,还是两者兼而有之?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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