Install Python and Pip¶
This library (obviously) requires a Python language runtime - the OpenXC library currently works with Python 2.6 and 2.7, but not Python 3.x.
Mac OS X and Linux
Mac OS X and most Linux distributions already have a compatible Python installed. Run python --version from a terminal to check - you need a 2.7.x version, such as 2.7.8.
- Download and run the [Python 2.7.x MSI installer](https://www.python.org/download/releases/2.7.8/). Make sure to select to option to Add python.exe to Path.
- Add the Python Scripts directory your PATH: PATH=%PATH%;c:\Python27\Scripts. If you aren’t sure how to edit your PATH, see this guide for all versions of Windows. Log out and back in for the change to take effect.
- Install [pip](https://pip.pypa.io/en/latest/installing.html#install-pip), a Python package manager by saving the get-pip.py script to a file and running it from a terminal.
From the setup.exe package list, select the python and python-setuptools packages. Then, inside Cygwin install pip using easy_install:
$ easy_install pip
Install the openxc Package¶
You can install or upgrade the OpenXC library from the Python Package Index (PyPI) with pip at the command line:
$ [sudo] pip install -U openxc
If you intend to use the library to connect to a vehicle interface via USB, you must also install a native USB backend - libusb-1.0 is the recommended library.
Mac OS X
First install Homebrew, then run:
$ brew install libusb
libusb is available in the main repository:
$ sudo apt-get install libusb-1.0-0
Install libusb using pacman:
$ sudo pacman -S libusbx
Download and install the OpenXC VI USB driver. You must install the driver manually through the Device Manager while the VI is plugged in and on - either running the emulator firmware so it never turns off, or plugged into a real car.
Install the VI USB driver as in a regular Windows installation.
If you get the error Skipping USB device: [Errno 88] Operation not supported or unimplemented on this platform when you run any of the OpenXC Python tools, make sure you do not have the libusb Cygwin package installed - that is explicitly not compatible.
Using the development version¶
You can clone the repository and install the development version like so:
$ git clone https://github.com/openxc/openxc-python $ cd openxc-python $ pip install -e .
Any time you update the clone of the Git repository, all of the Python tools will be updated too.