Support Support Home » APIs » Python » Python inst win

Python API - Windows installation steps

How to install the Ximea Python module:

To install our Python API into your Windows system please follow these steps:
  1. Install the Beta Release of the Ximea API SP - Select xiApiPython checkbox in the API list.
  2. Install Python - Download version suitable for your architecture from https://www.python.org/downloads/ and install it.
  3. Set Python path - Necessary if you want to use python from command prompt. This is the path to directory, where Python is installed. Go to Control Panel > System > Advanced system settings > Environment Variables > System variables > Path and click "Edit...". Add to the end of Variable value: ";C:\PythonXY;C:\PythonXY\Scripts" (without quotes), where XY is the version and subversion of installed Python. E.g. for Python2.7, add ";C:\Python27;C:\Python27\Scripts" (In case Python is installed in a different location, please add path to this location). It may be necessary to restart your computer for the changes to take effect.
  4. Install the Ximea module - Copy the whole folder \XIMEA\API\Python\v{x}\ximea (depending on the Python version) to site-packages.
    • for Python 2.x copy ximea folder placed in \XIMEA\API\Python\ v2\
    • for Python 3.x copy ximea folder placed in \XIMEA\API\Python\ v3\
      You can find the site-packages folder if you write this command into command prompt (path to python must be set correctly, see step 2.):
      python -c "import site;print(site.getsitepackages())" 

      You should see that the one of the paths is the path to the site-packages (e.g. C:\\Python27\\lib\\site-packages). To check if it is OK, in Python run:
      import ximea

Additional tools installation:

The following steps are optional. However, these steps are necessary for run all examples:

  1. pip (package manager) - Python versions >=2.7.9 and >=3.4 has pip already installed, so try to write this command into command prompt:
    pip --version

    It should print the version of pip. If not, please check if the path is correctly set (see step 2. above). If it is set correctly and you have older version of Python, install pip from this page or rather consider upgrading to newer version of Python.
  2. numpy (highly recommended) - Simply using pip, in command prompt write:
        pip install numpy
        and then in python run:
        import numpy
  3. matplotlib - In command prompt write:
    pip install matplotlib
    and then in python run:
    import matplotlib
  4. Pillow - In command prompt write:
        pip install Pillow
        and then in python run:
        import PIL

    Actually, it does not print version of Pillow. The real version can be find using "pip freeze" (in command prompt).
  5. OpenCV (only Python 2.7.x) - Follow steps 4. - 7. from OpenCV webpage:
  6. See the examples folder.