哪个 Linux 发行版更适合 Python Web 开发?
哪个 Linux 发行版更适合 Python Web 开发?
背景:
我目前在 Windows 上进行开发,这很好,但我希望将我的核心 Python 开发转移到 Linux。我确信大多数发行版都能正常工作,但是有人有理由相信一个发行版比另一个发行版更好吗?
Which linux distro is better suited for Python web development?
Background:
I currently develop on Windows and it's fine, but I am looking to move my core Python development to Linux. I'm sure most any distro will work fine, but does anyone have any reasons to believe one distro is better than another?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
很大程度上,发行版并不重要,因为 Python 已经存在,并且在几乎所有 Linux 发行版上基本上都是自给自足的。
如果你想专注于开发,我推荐 Ubuntu。 Ubuntu 可以说是功能最齐全的“为用户准备的”发行版之一,它使系统管理变得轻而易举,因此您可以专注于您想要解决的开发任务。
如果您的代码目标是 Linux 环境(例如 RedHat 等),那么请选择与您的目标环境相匹配的桌面发行版(例如,Fedora for RedHat、Gentoo for Gentoo、Ubuntu for Ubuntu Server,等)
否则,它们都适合。
Largely distribution won't matter, as Python is present and largely self sufficient on virtually all Linux distributions.
If you're wanting to focus on development, I'd recommend Ubuntu. Ubuntu is arguably one of the most fully featured "ready for the user" distributions that makes system administration a snap, so you can focus on the development tasks you want to tackle.
If you have a Linux environment that's a target for your code (like say, RedHat or something), then go with the desktop distribution that matches your target environment (like, say, Fedora for RedHat, Gentoo for Gentoo, Ubuntu for Ubuntu Server, etc.)
Otherwise, all of them are suitable.
您的发行版应该有 Python 2.6。否则就是一个选择的问题。
一个建议:永远不要以 root 身份安装任何东西(例如。
python setup.py install
)。仅使用发行版的包管理器安装内容,并使用 virtualenv 作为用户来安装其他包。Ubuntu有一个virtualenv包,甚至可以不安装就使用。
You distribution should have Python 2.6. Otherwise it's a matter of choice.
One advice: Never ever install anything as root (eg.
python setup.py install
). Only install things with your distribution's package manager and use virtualenv as a user to install other packages.Ubuntu has a virtualenv package and it can even be used without being installed.
使用具有最新稳定版本的 Python 的发行版只能让您使用这些版本测试代码。如今,开发人员可以轻松地使用多个 Python 版本来测试他们的代码。
Gentoo 可能为您提供最大的灵活性,可以同时安装多个 Python 版本:
例如,这不允许您在基于 Debian 的系统上非常流行的某些旧版本上进行测试。
pythonbrew 允许您在主目录中编译和安装多个 Python 版本,无需 root 访问权限。
借助“tox”,可以轻松使用多个版本的 Python 测试您的代码。默认情况下,tox 会找到您的系统 python,但您可以设置使用 pythonbrew 构建的自定义解释器。
这是一个可以与 Jenkins 一起使用的 tox.ini,以实现持续集成。通过此设置,您可以安装 jenkins,然后安装“su - jenkins”,并使用 pythonbrew 安装您想要测试的所有 Python 版本。
就是这么简单,而且您使用哪个 Linux 发行版并不重要。
有关配置 Jenkins 的详细信息,请参阅 Tox 网站。
Using a distribution with the latest stable versions of Python only lets you test your code with those versions. Today it's very easy for developers to test their code with multiple Python versions.
Gentoo probably gives you the most flexibility with multiple Python versions installed at once:
That doesn't let you test on some older versions that are very popular on Debian based systems, for example.
pythonbrew lets you compile and install multiple Python versions in your home directory, no root access needed.
It's a snap testing your code with multiple versions of Python thanks to 'tox'. By default, tox will find your system python(s), but you can set custom interpreters you build with pythonbrew, for example.
Here's a tox.ini you can use with Jenkins, for continuous integration. With this setup you can install jenkins then 'su - jenkins' and use pythonbrew to install all the Python versions you want to test.
It's that easy, and it doesn't matter which Linux distribution you use.
See the Tox website for details on configuring Jenkins.
我使用 RHEL 并且非常高兴,因此我认为 Fedora 会很好。我在家里使用 Debian,它很棒(虽然是无头的,所以那里没有网络)。
也就是说,我认为您可能应该根据您公司的使用情况或任何非 Python 原因来选择一个。我认为您不会发现 Python 工具的可用性对于任何 Linux 发行版来说都是一个问题。
I use RHEL and have been very happy, so from that I would say Fedora would be fine. I use Debian at home, and it's great (headless though, so no web there).
That said, I think you should probably just pick one based on what your company uses, or any number of non-Python reasons. I don't think you are going to find Python tool availability an issue with any Linux distribution.
大多数主要发行版都将包含 Python 和 Apache,因此这实际上只是一个选择问题。如果您是 Linux 新手,我建议您使用 Ubuntu 或 Fedora。两者都非常适合新用户,并且拥有出色的社区支持。
Most major distributions will include Python and Apache, so it's really just a matter of choice. If you're new to Linux, I'd suggest either Ubuntu or Fedora. Both are great for new users and have excellent community support.
正如到目前为止其他答案所提到的,Python 2.6 解释器将在所有最新的 Linux 发行版上可用。这不应该影响你的选择。
然而,您选择的 IDE 可能会消除一些可能性。您应该确保您选择的发行版具有适用于您的 IDE 最新版本的软件包,并且更新得足够频繁。
举个例子,我喜欢使用 Eclipse 和 PyDev 在任一操作系统中开发 Python 应用程序,但 Ubuntu 的官方存储库只有 Eclipse 3.2(从 2006 年开始),直到去年 10 月,他们最终在最新发行版中更新到 3.5。
As the other answers have mentioned so far, the Python 2.6 interpreter will be available on all recent Linux distribution releases. That shouldn't influence your choice.
However, your choice of IDE may eliminate some possibilities. You should make sure the distribution you select has a package for the latest version of your IDE, and that it is updated often enough.
As an example, I like to use Eclipse with PyDev for developing Python apps in either OS, but Ubuntu's official repositories had only Eclipse 3.2 (from 2006) until October of last year, when they finally updated to 3.5 in the latest distribution.
我正在 Cento 5.4 和 Fedora 12 上使用 Python,我非常高兴。
我还使用 Eclipse IDE 来处理 python 和其他语言,没有遇到任何重大问题。
I am working with Python on Cento 5.4 and Fedora 12 and I am very happy.
I also use Eclipse IDE for python and other languages without having any major issues.
任何桌面发行版,如 Ubuntu、OpenSUSE、Fedora...都可以,但如果您想始终拥有最新版本,我推荐 ArchLinux。
Any desktop distribution like Ubuntu, OpenSUSE, Fedora, ... is OK, But if you want to always have the latest versions, I recommend ArchLinux.
我想我记得当时 Guido Van Rossum 和他的核心团队 Python 开发人员的一个播客,其中一位核心 Python 开发人员现在受雇于 Canonical,负责 ubuntu 发行版的 Python 集成。这就解释了为什么 ubuntu 与其他发行版相比是一个更加 Pythonic 的发行版。
另一方面,gentoo linux发行版也在其Portage包管理系统中集成了python。所以我想说 gentoo 和 ubuntu 都适合 python 开发系统,并且各自代表了范围的两端。
i think i remember a podcast with Guido Van Rossum and his core team python developers back in the days, and one of that core python developer is now employed by Canonical to take care of python integration for the ubuntu distro. So that explains why ubuntu is a much more pythonic distro compared to other distro.
On the other hand, the gentoo linux distro also has python integrated in its Portage package management system. So gentoo and ubuntu I would say are good for python development system and each represent both ends of the spectrum.