INSTALL.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. .. default-role:: literal
  2. ================================
  3. Installation of multiprocessing
  4. ================================
  5. Versions earlier than Python 2.4 are not supported. If you are using
  6. Python 2.4 then you must install the `ctypes` package (which comes
  7. automatically with Python 2.5). Users of Python 2.4 on Windows
  8. also need to install the `pywin32` package.
  9. On Unix It's highly recommended to use Python 2.5.3 (not yet released) or
  10. apply the ``fork-thread-patch-2`` patch from `Issue 1683
  11. https://bugs.python.org/issue1683`_.
  12. Windows binary builds for Python 2.4 and Python 2.5 are available at
  13. https://pypi.org/project/multiprocessing/
  14. Python 2.6 and newer versions already come with multiprocessing. Although
  15. the stand alone variant of the multiprocessing package is kept compatible
  16. with 2.6, you mustn't install it with Python 2.6.
  17. Otherwise, if you have the correct C compiler setup then the source
  18. distribution can be installed the usual way::
  19. python setup.py install
  20. It should not be necessary to do any editing of `setup.py` if you are
  21. using Windows, macOS or Linux. On other unices it may be necessary
  22. to modify the values of the `macros` dictionary or `libraries` list.
  23. The section to modify reads ::
  24. else:
  25. macros = dict(
  26. HAVE_SEM_OPEN=1,
  27. HAVE_SEM_TIMEDWAIT=1,
  28. HAVE_FD_TRANSFER=1
  29. )
  30. libraries = ['rt']
  31. More details can be found in the comments in `setup.py`.
  32. Note that if you use `HAVE_SEM_OPEN=0` then support for posix
  33. semaphores will not been compiled in, and then many of the functions
  34. in the `processing` namespace like `Lock()`, `Queue()` or will not be
  35. available. However, one can still create a manager using `manager =
  36. processing.Manager()` and then do `lock = manager.Lock()` etc.
  37. Running tests
  38. -------------
  39. To run the test scripts using Python 2.5 do ::
  40. python -m multiprocessing.tests
  41. and on Python 2.4 do ::
  42. python -c "from multiprocessing.tests import main; main()"
  43. The sources also come with a Makefile. To run the unit tests with the
  44. Makefile using Python 2.5 do ::
  45. make test
  46. using another version of Python do ::
  47. make test PYTHON=python2.4
  48. This will run a number of test scripts using both processes and threads.
  49. Running examples
  50. ----------------
  51. The make target `examples` runs several example scripts.
  52. Building docs
  53. -------------
  54. To build the standalone documentation you need Sphinx 0.5 and setuptools
  55. 0.6c9 or newer. Both are available at https://pypi.org/. With
  56. setuptools installed, do ::
  57. sudo easy_install-2.5 "Sphinx>=0.5"
  58. make doc
  59. The docs end up in ``build/sphinx/builder_name``.