windows 什么 linux 发行版更适合 Python Web 开发?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2021803/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What linux distro is better suited for Python web development?
提问by Ryan Montgomery
Which linux distro is better suited for Python web development?
哪个 linux 发行版更适合 Python Web 开发?
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?
我目前在 Windows 上开发,这很好,但我希望将我的核心 Python 开发转移到 Linux。我确信大多数发行版都可以正常工作,但是有人有任何理由相信一个发行版比另一个更好吗?
回答by Travis Bradshaw
Largely distribution won't matter, as Python is present and largely self sufficient on virtually all Linux distributions.
很大程度上分发无关紧要,因为 Python 在几乎所有 Linux 发行版上都存在并且在很大程度上自给自足。
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.
如果您想专注于开发,我建议您使用 Ubuntu。Ubuntu 可以说是功能最齐全的“为用户准备好”的发行版之一,它使系统管理变得轻而易举,因此您可以专注于您想要处理的开发任务。
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.)
如果你有一个 Linux 环境作为你的代码的目标(比如 RedHat 或其他东西),然后使用与你的目标环境匹配的桌面发行版(比如,Fedora for RedHat,Gentoo for Gentoo,Ubuntu for Ubuntu Server,等等。)
Otherwise, all of them are suitable.
否则,所有这些都是合适的。
回答by ebo
You distribution should have Python 2.6. Otherwise it's a matter of choice.
你的发行版应该有 Python 2.6。否则就是一个选择的问题。
One advice: Never ever install anything as root (eg. python setup.py install
). Only install things with your distribution's package manager and use virtualenvas a user to install other packages.
一个建议:永远不要以 root 身份安装任何东西(例如python setup.py install
)。只用你的发行版的包管理器安装东西,并使用virtualenv作为用户安装其他包。
Ubuntu has a virtualenv package and it can even be used without being installed.
Ubuntu 有一个 virtualenv 包,它甚至可以在不安装的情况下使用。
回答by cakebread
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.
使用带有最新稳定版本 Python 的发行版只能让您使用这些版本测试您的代码。今天,开发人员可以很容易地使用多个 Python 版本测试他们的代码。
Gentoo probably gives you the most flexibility with multiple Python versions installed at once:
Gentoo 可能会为您提供最大的灵活性,同时安装多个 Python 版本:
(2.5) 2.5.4-r4
(2.6) 2.6.6-r2 or 2.6.7-r2
(2.7) 2.7.2-r3
(3.1) 3.1.4-r3
(3.2) 3.2.2
That doesn't let you test on some older versions that are very popular on Debian based systems, for example.
例如,这不允许您在基于 Debian 的系统上非常流行的一些旧版本上进行测试。
pythonbrewlets you compile and install multiple Python versions in your home directory, no root access needed.
pythonbrew允许您在主目录中编译和安装多个 Python 版本,无需 root 访问权限。
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.
由于“ tox”,使用多个版本的 Python 快速测试您的代码。默认情况下,tox 会找到你的系统 python(s),但你可以设置你用 pythonbrew 构建的自定义解释器,例如。
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.
这是一个可以与 Jenkins 一起使用的 tox.ini,用于持续集成。通过此设置,您可以先安装 jenkins,然后再安装 'su - jenkins' 并使用 pythonbrew 安装您要测试的所有 Python 版本。
[tox]
envlist = py267,py271,py272
[testenv]
#You may need to change this. Are your tests here?
changedir=tests
#You can also use nose, etc., see documentation
deps=pytest
commands=py.test --junitxml=junit-{envname}.xml
[testenv:py272]
basepython=/var/lib/jenkins/.pythonbrew/pythons/Python-2.7.2/bin/python2.7
[testenv:py271]
basepython=/var/lib/jenkins/.pythonbrew/pythons/Python-2.7.1/bin/python2.7
[testenv:py267]
basepython=/var/lib/jenkins/.pythonbrew/pythons/Python-2.6.7/bin/python2.6
It's that easy, and it doesn't matter which Linux distribution you use.
就这么简单,您使用哪个 Linux 发行版都没有关系。
See the Tox website for details on configuring Jenkins.
有关配置 Jenkins 的详细信息,请参阅 Tox 网站。
回答by typelogic
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.
我想我记得过去与 Guido Van Rossum 和他的核心团队 Python 开发人员的播客,其中一位核心 Python 开发人员现在被 Canonical 聘用,负责 ubuntu 发行版的 Python 集成。所以这就解释了为什么 ubuntu 与其他发行版相比是一个更加 Pythonic 的发行版。
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.
另一方面,gentoo linux 发行版也在其 Portage 包管理系统中集成了 python。所以我会说 gentoo 和 ubuntu 对 python 开发系统有好处,每个都代表了频谱的两端。
回答by Tim Crone
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).
我使用 RHEL 并且非常高兴,因此我会说 Fedora 会很好。我在家里使用 Debian,它很棒(虽然是无头的,所以那里没有网络)。
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 原因选择一个。我认为您不会发现 Python 工具可用性是任何 Linux 发行版的问题。
回答by Erich Douglass
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 和 Apache,因此这实际上只是一个选择问题。如果您不熟悉 Linux,我建议您使用 Ubuntu 或 Fedora。两者都非常适合新用户,并具有出色的社区支持。
回答by Steven T. Snyder
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.
正如迄今为止其他答案所提到的,Python 2.6 解释器将在所有最新的 Linux 发行版中可用。这不应该影响你的选择。
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.
但是,您选择的 IDE 可能会消除某些可能性。您应该确保您选择的发行版包含适用于最新版本 IDE 的包,并且它的更新频率足够高。
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.
例如,我喜欢将 Eclipse 与 PyDev 用于在任一操作系统中开发 Python 应用程序,但 Ubuntu 的官方存储库只有 Eclipse 3.2(从 2006 年开始),直到去年 10 月它们最终在最新发行版中更新到 3.5。
回答by TheMadAdmin
I am working with Python on Cento 5.4 and Fedora 12 and I am very happy.
我正在 Cento 5.4 和 Fedora 12 上使用 Python,我很高兴。
I also use Eclipse IDE for python and other languages without having any major issues.
我还将 Eclipse IDE 用于 python 和其他语言,而没有任何重大问题。
回答by saeedgnu
Any desktop distribution like Ubuntu, OpenSUSE, Fedora, ... is OK, But if you want to always have the latest versions, I recommend ArchLinux.
任何桌面发行版,如 Ubuntu、OpenSUSE、Fedora ……都可以,但如果你想始终拥有最新版本,我推荐 ArchLinux。