What linux distro is better suited for Python web development?

泄露秘密 提交于 2019-12-21 13:11:25

问题


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?


回答1:


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.




回答2:


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.




回答3:


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:

    (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.

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.

[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.

See the Tox website for details on configuring Jenkins.




回答4:


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.




回答5:


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.




回答6:


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.




回答7:


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.




回答8:


Any desktop distribution like Ubuntu, OpenSUSE, Fedora, ... is OK, But if you want to always have the latest versions, I recommend ArchLinux.




回答9:


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.



来源:https://stackoverflow.com/questions/2021803/what-linux-distro-is-better-suited-for-python-web-development

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!