简体   繁体   English

Mac OS X中的Python软件包管理

[英]Python package management in Mac OS X

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. 每次我尝试在Mac OS X上为python安装新软件包时,都会遇到此问题,这些软件包具有使用不同软件包管理工具进行设置的不同方法。 Specially for new versions of Mac OS X 10.9 Mavericks, some of installers are buggy, then I needed to switch between them. 特别是对于Mac OS X 10.9 Mavericks的新版本,某些安装程序存在问题,因此我需要在它们之间进行切换。 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. 我要简短描述一下这些主要的命令行安装程序,并进行比较: easy_installpipportapt-getbrewfink等。当然,有时候除了通过源代码make install安装之外别无其他方法make installpython setup.py.pkg安装程序文件。 But I guess that's not the case when you need to install more complicated packages with lots of dependencies. 但是我想当您需要安装具有很多依赖关系的更复杂的程序包时,情况并非如此。

What I'm asking has two sides: 我要问的有两个方面:

  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) (至少brew会警告port可用性)
  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 and easy_install are for python libraries. pip和easy_install用于python库。
  2. apt-get, brew, fink, port, etc. These tools are 'distro style' package management tools. 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 is the tool endorsed by the most python developers and the python packaging SIG going forward, so TLDR; pip是大多数python开发人员和以后的python打包SIG认可的工具,因此TLDR; use pip not easy_install 使用pip not easy_install

these tools also work with virtualenvs and virtualenvs are great. 这些工具也可以与virtualenvs一起使用,virtualenvs很棒。 use them :) 使用它们 :)

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. 但是,当您尝试使用pip构建python软件包时,会遇到需要python不太了解该怎么做的其他库。 It is these moments that make it necessary to have one of the other tools. 正是这些时刻使得拥有其他工具之一成为必要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM