What exactly do distutils do?

I read the documentation, but I do not understand.

Why should I use distutils to install python modules?

Why can't I just save modules in python path?

+5
source share
3 answers

You do not need to use distutils. You can install the modules manually, just like you can manually compile the C ++ library (compile each implementation file, then link the .obj files) or manually install the application (compile, put in your own directory, add a shortcut to run). This is simply tedious and error prone, as each repetitive task is performed manually. Moreover, the manual steps that I listed for examples are quite optimistic - often you want to do more. For example, PyQt adds the .ui-to-.py compiler to the path, so you can invoke it through the command line. This way you get a stack of work that can be automated. This in itself is a good argument.

, . distutils .. , ( , ) - , , site-packages, .

, , .

+5

python? python, pypi, :

 pip install <name_of_package> 

, .tar.gz - , setup.py :

  python setup.py install 

( ):

  python setup.py develop

python (setup.py); setup.py - , disutils.

distutils - python, python, , setup.py install.

, disutils ( ):

  • ( ).
  • -,
  • .
  • .
  • pypi.

http://docs.python.org/library/distutils.html

+4

distutils, ; python .

When you decide to publish your modules for use by others, distutils provides a standard way to install modules on your computers. (โ€œDistโ€ in โ€œdistutilsโ€ means distribution, as in distributing your software to others.)

+2
source

All Articles