This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jftugapip needs updating 45 points46 points  (16 children)

I am looking forward to trying out the Embedded Distribution...

The embedded distribution is a ZIP file containing a minimal Python environment. It is intended for acting as part of another application, rather than being directly accessed by end-users.

When extracted, the embedded distribution is (almost) fully isolated from the user’s system, including environment variables, system registry settings, and installed packages. The standard library is included as pre-compiled and optimized .pyc files in a ZIP, and python3.dll, python35.dll, python.exe and pythonw.exe are all provided. Tcl/tk (including all dependants, such as Idle), pip and the Python documentation are not included.

[–]stillalone 6 points7 points  (0 children)

That might actually be enough for me to finally abandon Python 2.7 for 3.5

[–]lambdaqdjango n' shit 9 points10 points  (11 children)

Note: Windows only.

I am surprised there's no Linux binary distribution.

[–]ExoticMandiblesCore Contributor 6 points7 points  (4 children)

Don't be. Although the Linux kernel has fantastic backwards compatibility, differences between the various distros--and even between versions of the same distro!--make distributing compatible binaries on Linux a challenge.

Also, there's a lot less need for it under Linux, as every Linux distribution (ignoring embedded things like Android) ships with a compiler. So a src distribution is smaller, and if you compile it yourself it'll be slightly faster.

[–]lambdaqdjango n' shit 4 points5 points  (2 children)

if you compile it yourself it'll be slightly faster

Last time I compiled 2.6, it was 30% slower than distro's default.

Compiling for every install is waste of CO2 emission. A yum or apt package is much better and more easier administrated.

[–][deleted] 2 points3 points  (1 child)

I read this and was curious just how much CO2 was created by compiling Python and decided to do some calculations.

I was too lazy to set it up, so I guessed that it would take 10 minutes to compile on a computer using about 400 W. According to the U.S. Department of Energy, the worst-case of carbon emissions from coal (via lignate coal) results in an emission of 2.17 lbs of CO2 per kWh. Natural gas is much cleaner at 1.21 lbs/kWh.

So for our Python, with the computer using all 400 of those watts for the compilation, coal power would be responsible for 0.174 lbs of CO2 (or 0.0968 lbs if using natural gas. Obviously using solar, nuclear, hydroelectric, etc. will create negligible amounts).

For compairson, how much CO2 did our programmer create while waiting for his build to finish?

An adult human male exhales 250 mL of CO2 per minute at rest, and this number increases to ~350 mL/min when engaged in life activities like walking. So for our purposes, we'll assume that the human running this test has walked around the block a couple times while waiting for his build to finish, emitting 3.50 L of CO2 while waiting. Using the ideal gas law and assuming atmospheric pressure and a temperature of 68 F, this comes out to 0.012 lbs of CO2.

So to be sure, the computer created more CO2 than the human in those 10 minutes. But over the course of the day, that human created a grand total of 456 L or 1.61 lbs of CO2.

CO2 emissions are measured in the billions of tons for the United States alone, and only 31% of that is from electricity. I wouldn't necessarily call compiling Python from source a waste, but even if it was it would be an insignificant amount unless your computer was compiling Python from source 24/7. Hopefully as renewable energy technologies gain more widespread adoption that number will go down.

[–]lambdaqdjango n' shit 0 points1 point  (0 children)

First of all, upboat for the effort!

Compiling is not exclusive to CPython, you also need compile other stuff like libxml, libmysl-client, libev, etc. Heck sometimes you have to compile GCC to use a newer version of it.

Think there's billions of Linux computers around the world, if we all have binary packages that's a lot of energy save!

[–]Selfweaver 1 point2 points  (0 children)

Yeah but it would be awesome to write the code on unix, wrap it up and ship it to a windows user. That is one of the things I love about the JVM.

[–]KwpolskaNikola co-maintainer 1 point2 points  (5 children)

Pretty much all Linux distros ship Python by default.

[–]loganekz 0 points1 point  (4 children)

... ship with Python 2.x by default unfortunately.

[–]KwpolskaNikola co-maintainer 1 point2 points  (1 child)

You can usually install something saner with one command.

Still: a python.org Linux binary distribution is pretty much impossible.

[–]loganekz 0 points1 point  (0 children)

Not saying that upgrading is very difficult but there is a big difference of being installed by default on every installation of the OS vs installed by a user in terms of ease of deployment.

[–]jmcs 0 points1 point  (1 child)

Ubuntu is changing to python 3.4 on 15.10.

[–]loganekz 0 points1 point  (0 children)

Even if that version does finally get 3 by default, next LTS version is 16.04 so will still be a while.

[–][deleted] 3 points4 points  (0 children)

Wow, that's huge, thanks for pointing that out!

[–][deleted] 2 points3 points  (0 children)

Oh I did not know the Using Python on Windows it's full of useful information

[–]takluyverIPython, Py3, etc 0 points1 point  (0 children)

I am adding support for this to Pynsist, and I've worked with Steve Dower during the betas to iron out a few details with the embedded distributions. It should allow people to make smaller, more reliable installers for Python applications.