使用pip和apt-get安装软件包之间有什么区别? [英] What is the difference between installing a package using pip vs. apt-get?
问题描述
我正在尝试在Ubuntu计算机上部署Django站点.我需要安装Psycopg2和PIL,但似乎可以使用apt-get或pip来安装它们.两种方法的安装是否有所不同?我知道使用pip可以将其安装到虚拟环境中,而使用apt-get可以将其安装在全局python环境中.
I'm trying to deploy a Django site on an Ubuntu machine. I need to install Psycopg2 and PIL but it seems that I'm able to install them using either apt-get or using pip. Is there a difference in installing by the two methods? I know that using pip, I'm able to install it into a virtual environment but with apt-get it installs in the global python environment.
推荐答案
您可能已经知道apt-get的好处.自动更新通知,需要那些工具的其他易于安装的软件包都知道它们已安装,等等.
You probably already know the benefits of apt-get. Automatic update notifications, other apt-installed packages that need those tools know they're installed, etc.
使用pip,您知道在安装时会获得最新版本,可以安装到非默认版本的Python,也可以安装到virtualenv.
With pip, you know you're getting the latest version at the time you install it, you can install to a non-default version of Python, and you can install to a virtualenv.
如果您不需要pip所提供的任何功能,并且您不必例行安装APT上无法提供的其他Python软件包,请使用APT版本.
If you don't need any of the features pip gives you, and you don't routinely have to install other Python packages which aren't available over APT, use the APT versions.
这篇关于使用pip和apt-get安装软件包之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!