Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "binary Python packages" mean, given that python is a script language?

Tags:

python

binary

I read something like this

ITK is distributed in binary Python packages. To install:

pip install itk

What does "binary Python packages" mean, given that python is a script language (that is to be interpreted rather than compiled)?

like image 334
zell Avatar asked Feb 16 '26 12:02

zell


2 Answers

A binary Python package is usually a packaged Python library that comes with one or more pre-compiled binary modules. Theses modules are usually .so or .dll libraries in binary (compiled) form. They are often written in C.

Such binary distributions of Python packages are in most cases very dependent on the platform they are created for.

like image 116
Klaus D. Avatar answered Feb 18 '26 02:02

Klaus D.


ITK is primarily written in C++. ITK-python provides a Python interface to the underlying C++ routines. If ITK were pure Python code it would be orders of magnitude slower.

To create that Python interface SWIG is used to create the glue code, and that SWIG produced code is in C/C++. Therefore the ITK-python interface (and the ITK code underlying it) needs to be compiled for every platform (Linux, Mac, Windows and every version of Python).

like image 27
Dave Chen Avatar answered Feb 18 '26 04:02

Dave Chen