Mac OS X中的Python软件包管理 [英] Python package management in Mac OS X

查看:65
本文介绍了Mac OS X中的Python软件包管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我尝试在Mac OS X上为python安装新软件包时,都会遇到此问题,这些软件包具有使用不同软件包管理工具进行设置的不同方法.特别是对于Mac OS X 10.9 Mavericks的新版本,某些安装程序存在问题,因此我需要在它们之间进行切换.我要求对以下主要命令行安装程序进行简短描述和比较:easy_installpipportapt-getbrewfink等.当然,有时除了通过源代码make installpython setup.py.pkg安装程序文件进行安装之外,别无其他方法.但是我想当您需要安装具有很多依赖关系的更复杂的程序包时,情况并非如此.

Every time I tried to install a new package for python on Mac OS X, I had this issue which these packages had different ways to setup with different package management tools. Specially for new versions of Mac OS X 10.9 Mavericks, some of installers are buggy, then I needed to switch between them. I'm asking for a short description and comparison between these main command-line installers: easy_install, pip, port, apt-get, brew, fink, and etc. Of course, sometimes there is no way other than installing through source code make install, python setup.py, or .pkg installer files. But I guess that's not the case when you need to install more complicated packages with lots of dependencies.

我要问的有两个方面:

  1. 并排使用它们是否安全?还是这些命令行工具之间存在任何已知的冲突? (至少brew会针对port的可用性发出警告)
  2. 如果我们在包管理之间进行选择,是否存在基于这些程序包管理的性质的已知缺点和优点?
  1. Is it safe to use them side by side? or are there any known conflicts between these command-line tools? (at least brew throws warnings on port availability)
  2. Is there any known cons and pros based on nature of these package managements, in case when we had choice between them?

推荐答案

  1. pip和easy_install用于python库.
  2. apt-get,brew,fink,port等.这些工具是发行版"软件包管理工具.

在为什么我需要每个都需要一个?"方面,它们有一个重叠的区域.那就是图书馆的依赖.

They have one area of overlap in terms of 'why do i need one of each?' and that is Library dependencies.

pip是大多数python开发人员和以后的python打包SIG认可的工具,因此TLDR;使用pip not easy_install

pip is the tool endorsed by the most python developers and the python packaging SIG going forward, so TLDR; use pip not easy_install

这些工具也可以与virtualenvs一起使用,virtualenvs很棒.使用它们:)

these tools also work with virtualenvs and virtualenvs are great. use them :)

但是,当您尝试使用pip构建python软件包时,可能会遇到需要python不太了解该怎么做的其他库.正是这些时刻,才有必要使用其他工具之一.

You will however run into occasions where you need other libraries that python doesnt quite know what to do with when you try and build a python package with pip. It is these moments that make it necessary to have one of the other tools.

这篇关于Mac OS X中的Python软件包管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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