How to install Python package from source on Windows

bartc bc at freeuk.com
Tue May 16 09:41:39 EDT 2017


On 15/05/2017 19:21, Chris Angelico wrote:
> On Tue, May 16, 2017 at 4:12 AM, Deborah Swanson
> <python at deborahswanson.net> wrote:
>> It continues to amaze me that Anaconda and Python.org, probably the two
>> biggest distributors of official Python builds, are now relying on
>> Visual C++. Why can't Python developers write the entire setup and
>> installation code in Python? Surely Python has the required
>> functionality, and it seems more than a little demeaning for Python to
>> be using Visual C++ as a crutch.
>
> Are you suggesting that a C compiler should be written in Python?
> Because you're dealing with an extension library. It's not written in
> pure Python. That's why it needs a C compiler. While it is certainly
> possible to write a C compiler in Python, it is unlikely to outperform
> the existing popular compilers (gcc, clang, msvc, etc), which have had
> many years of expertise poured into them.

In what way, compilation speed, or speed of the generated code?

In terms of compilation speed, efficient algorithms (and overall size) 
are more important than implementation language, and gcc especially is 
not hard to beat, even with an interpreted compiler (I've done that), 
but anyway it probably wouldn't be too far behind.

And for a one-off task such as compiling an existing, working package, 
build speed doesn't matter so much.

With output code, for running a substantial application, all these 
compilation optimisations don't make as much difference as you might 
think (you can get within a factor of 2x easily even with poor code).

But again, in order to get something working, when the alternative is 
having nothing working, then that can be acceptable as a temporary 
workaround.

(Note that I am talking about a compiler written in /any/ language, but 
that would still generate native code.)

-- 
bartc



More information about the Python-list mailing list