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
      print(ximea.__version__)
      

Additional tools installation:

The following steps are optional. However, these steps are necessary for running 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 the command prompt:
    pip --version
    
    It should print the version of the pip. If not, please check if the path is correctly set (see step 2. above). If it is set correctly and you have an older version of Python, install pip from this page or consider upgrading to a 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
    numpy.__version__
    
  3. matplotlib - In command prompt write:
    pip install matplotlib
    
    and then in python run:
    import matplotlib
    matplotlib.__version__
    
  4. Pillow - In the command prompt write:
    pip install Pillow
    
    and then in python run:
    import PIL
    PIL.__version__
    
  5. OpenCV

Examples

See the examples folder: \XIMEA\API\Python\examples