Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are python libraries not supplied as pyc? [closed]

Tags:

python

pyc

If I am right in understanding, Python compile files are cross platform. So why are most libraries released requiring a build and install?

Is it laziness on the part of the distributer, or am I wrong in saying they could simply distribute the pyc files? If this isn't the case, how do I distribute a python script file that has libraries as prerequist without requiring the user to build and install the libraries?

like image 388
Cheetah Avatar asked Apr 17 '13 12:04

Cheetah


1 Answers

Because the format of the contained code can change with each (major) Python release, while source code at least can be compatible. The format can also differ between implementations (of which there are several, the two most well-known are CPython and PyPy.

See this article for more information about the internal structure of .pyc files.

like image 54
unwind Avatar answered Sep 28 '22 09:09

unwind