How to install Python package from source on Windows

bartc bc at freeuk.com
Sun May 21 20:51:07 EDT 2017


On 22/05/2017 01:17, Gregory Ewing wrote:
> I think what Bart is saying is that the Python developers should
> provide an amalgamated source file that's pre-configured for
> Windows, so that someone who wants to compile on Windows doesn't
> have to deal with all the complexities of the general build
> system.

The 'one-file' idea is one approach to simplifying the building of 
open-source applications. Probably, it's more suited to those who just 
want to try out, or use, a bit of software.

(The GMP library, for example, has no official binary releases. You have 
to build from source, and I think it has an even longer configure script 
than CPython! The end-result is a single .dll file of a few hundred KB.

Even if I could get a binary myself, if I make use of it as a 
dependency, anyone building my software would also have to acquire it 
and build it from source. And it might not work. Result: I don't use gmp.)

For CPython, yes, the files are all over the place, but that wouldn't be 
so bad if at least it was possible to just compile them and link in the 
various bits. But all sorts of other things are going on, and that info 
is not provided.

> While that might be possible, I don't see what how it would be
> of much use. You're not going to want to edit such a "source" file,
> so its only use would be to install as-is. But if that's all
> you want, you might as well use a binary installer.

A one-file CPython might be under 250Kloc, not too bad to play with, but 
I'm not sure it would work as there are multiple binary files to build, 
not a single executable. (Maybe one source per executable, but that 
would still need discrete, shared headers otherwise there would be 
duplication.)

I think it would be on the cards to have a streamlined CPython 
distribution that only had a C compiler as a requirement, and nothing 
else. Unless I'm missing something.

-- 
Bartc



More information about the Python-list mailing list