install.rst 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. ------------
  2. Installation
  3. ------------
  4. bcolz depends on NumPy and, optionally, Numexpr. Also, if you are
  5. going to install from sources, and a C compiler (Clang, GCC and MSVC
  6. 2008 for Python 2, and MSVC 2010 for Python 3, have been tested).
  7. Installing from PyPI repository
  8. ===============================
  9. Do::
  10. $ easy_install -U bcolz
  11. or::
  12. $ pip install -U bcolz
  13. Installing Windows binaries
  14. ===========================
  15. Unofficial Windows binaries are provided by Christoph Gohlke and can be
  16. downloaded from:
  17. http://www.lfd.uci.edu/~gohlke/pythonlibs/#bcolz
  18. Using the Microsoft Python 2.7 Compiler
  19. =======================================
  20. As of Sept 2014 Microsoft has made a Visual C++ compiler for Python 2.7
  21. available for download:
  22. http://aka.ms/vcpython27
  23. This has been made available specifically to ease the handling of Python
  24. packages with C-extensions on Windows (installation and building wheels).
  25. It is possible to compile bcolz with this compiler (Jan 2015), however,
  26. you may need to use the following patch::
  27. diff --git i/setup.py w/setup.py
  28. index d77d37f233..b54bfd0fa1 100644
  29. --- i/setup.py
  30. +++ w/setup.py
  31. @@ -11,8 +11,8 @@ from __future__ import absolute_import
  32. import sys
  33. import os
  34. import glob
  35. -from distutils.core import Extension
  36. -from distutils.core import setup
  37. +from setuptools import Extension
  38. +from setuptools import setup
  39. import textwrap
  40. import re, platform
  41. Installing from tarball sources
  42. ===============================
  43. Go to the bcolz main directory and do the typical distutils dance::
  44. $ python setup.py build_ext --inplace
  45. In case you have Blosc installed as an external library you can link
  46. with it (disregarding the included Blosc sources) in a couple of ways:
  47. Using an environment variable::
  48. $ BLOSC_DIR=/usr/local (or "set BLOSC_DIR=\blosc" on Win)
  49. $ export BLOSC_DIR (not needed on Win)
  50. $ python setup.py build_ext --inplace
  51. Using a flag::
  52. $ python setup.py build_ext --inplace --blosc=/usr/local
  53. It is always nice to run the tests before installing the package::
  54. $ PYTHONPATH=. (or "set PYTHONPATH=." on Windows)
  55. $ export PYTHONPATH (not needed on Windows)
  56. $ python -c"import bcolz; bcolz.test()" # add `heavy=True` if desired
  57. And if everything runs fine, then install it via::
  58. $ python setup.py install
  59. Testing the installation
  60. ========================
  61. You can always test the installation from any directory with::
  62. $ python -c "import bcolz; bcolz.test()"