News for hackers. Stuff that matters.
Re:Python for Humans by rmc on Tuesday January 03, 2012 @10:42AM (#3419951)
This makes a lot of good points, but some bad ones.

Esp. the "installing python" one. Just use your package manager to install all the versions you need.

And for "Packaging and Dependencies", just use pip.

Re:Python for Humans by j_baker on Tuesday January 03, 2012 @12:18PM (#3420363)
What if your package manager doesn't support the version of Python you're targeting? The most common place this happens is if you have some old RHEL 5 boxen that haven't been upgraded (and who that uses RHEL doesn't?). Or suppose you use python 2.7, which isn't supported by very many (any?) "stable" linuces (aka Debian stable, RHEL, Ubuntu LTR, etc).

And installing packages into the system python (if that's what you're suggesting) is the path to madness. It's much better to use virtualenvs you can throw away at will. All in all, it's usually best just to leave the system Python alone to avoid causing problems with any other packages that may depend on it being in a consistent state.

Re:Python for Humans by mindrunner on Tuesday January 03, 2012 @11:19PM (#3422722)
This problem really echoed with me. The one thing I hate about Python is the pain of compiling it from source.

Unlike startups, we enterprise dudes don't have the liberty of choosing the latest distros with better base Python versions.in some cases,the machines don't even have a compiler installed.

Try running your funky new admin script on these rhel5 boxen is a pain.

I've resorted to compiling with LD_RUN_PATH, -rpath & -r set.

I think this should be included in the python-guide for the sanity of other devops dudes

Re:Python for Humans by engtech on Tuesday January 03, 2012 @10:47AM (#3419971)
I agree that people should use a good package manager, but the reality of the corporate env world is that you'll be trying to use the latest Python on some ridiculously old unix install without root access, and you'll never be able to get IT to install the latest for all users.
Re:Python for Humans by joshbaptiste on Tuesday January 03, 2012 @11:01AM (#3420041)
+1 for you sir, we are constantly fighting with Unix admins who refuse to install anything but the generic terribly old 2.3 - 2.4 Python versions that are bundled with their default enterprise Suse packages, which only leads to full /home issues since everyone just downloads their own versions, compiling extensions manually.
Re:Python for Humans by antoncohen on Tuesday January 03, 2012 @07:25PM (#3422043)
Or you could write the applications for the systems they will run on. Why develop in the latest Ubuntu with Python 2.7 when you know your company runs RHEL 5 or SUSE with Python 2.4?

I know it was annoying how long RHEL lasted with Python 2.4, but now the latest RHEL, Debian-stable, and Ubuntu LTS all have Python 2.6, so write to Python 2.6 if your company uses those OSs, there's not excuse to write incompatible code targeted at Python 2.7.

In many Linux distributions it is impossible to replace the Python version, core parts of the OS like package management will break. It is possible to install another version in parallel and use "virtualenv --python=" to use it for an application. If you are using RHEL/CentOS 5 you can install the python26 package from the EPEL repository.

Re:Python for Humans by tbatterii on Tuesday January 03, 2012 @11:42AM (#3420220)
What's the package manager for windows?

Mostly I agree with you, but installing python on windows is a PITA compared to *nix.

PIP works until you need something that requires compiling extensions which is also a PITA on windows.

IIRC easy_install can install binaries, but I could be wrong about that since I don't do windows development anymore and thus pip works for me 99% of the time.

Regardless, my point is, though I think we all wish it was as simple as using your package manager and pip, it simply isn't that way for everyone.

And it probably never will be, but we can always make it simpler. :)

Re:Python for Humans by d0mine on Tuesday January 03, 2012 @12:52PM (#3420523)
PIP works until you need something that requires compiling extensions </quote>

You could use *.exe installers such as http://www.lfd.uci.edu/~gohlke/pythonlibs/

Advanced users could use mingw to compile extensions.

Re:Python for Humans by tbatterii on Tuesday January 03, 2012 @07:51PM (#3422136)
"You could use *.exe installers" yeah I know, but then you aren't using PIP, and how's that work with virtualenv? Again, not as simple as some would have you believe.
Re:Python for Humans by Lazare on Tuesday January 03, 2012 @08:07PM (#3422192)
Actually, the windows binary installers work perfectly with virtualenv, and is perfectly simple: http://stackoverflow.com/questions/3271590/can-i-install-pyt...

(It is, however, poorly documented.)

Re:Python for Humans by rmc on Tuesday January 03, 2012 @12:21PM (#3420375)
I would not use Windows for servers.
Re:Python for Humans by j_baker on Tuesday January 03, 2012 @12:28PM (#3420409)
Neither would I. But some people are stuck in jobs where they have to support Windows. If that's never been the case for you, consider yourself lucky.
Re:Python for Humans by tbatterii on Tuesday January 03, 2012 @12:33PM (#3420426)
neither would I. but I'm not pretending they don't exist to prove a point :)

Whether you or I prefer it or not, there are lots of people who either by choice or not develop on windows and in some cases deploy to windows servers.

And for those people, things aren't as simple as "use the package manager and pip" no matter how much anyone would like it to be.

reality sucks.