Reputation: 28050
What is the purpose of setuptools in Python? What if I do not have setuptools or never upgrade setuptools?
I read the documentation, but I cannot get the answer.
Upvotes: 48
Views: 37385
Reputation: 15926
Setuptools is a package development process library designed to facilitate packaging Python projects by enhancing the Python standard library distutils (distribution utilities).
Essentially, if you are working with creating and distributing Python packages, it is very helpful.
Upvotes: 1
Reputation: 126827
setuptools
is a package used by many other packages to handle their installation from source code (and tasks related to it).
It is generally used extensively for non-pure-Python packages, which need some compilation/installation step before being usable (think packages containing extensions written in C); setuptools
factors away some of the most common operations used in this process (compiling C files with options compatible with the current Python installation, running Cython if required, provide some vaguely coherent set of commands/options for setup.py files, ...) as well as providing some tools used during Python packages development.
There is some kind of overlap with distutils, distutils2 (?) and some of the other packages setup tools that I never actually managed to understand; honestly, it's a part of the Python ecosystem that is quite a big mess.
The point is, if you:
you generally don't need to worry about setuptools - either it isn't really needed, or the high-level installers will make sure you have a recent enough version installed; in this last case, as long as the operations they have to do are simple enough generally they won't fail.
Otherwise, unfortunately you are going to spend some fun hours trying to understand who on earth between setup.py and the compiler is adding command line switches that make the compilation fail, or screw up the include paths, or expect libraries to be in a different path, or misdetect the compiler, or try to install stuff into the wrong paths or any combination of the above.
Upvotes: 53