$ pip install cybox
You might also want to consider using a virtualenv.
The python-cybox library is developed on Python 2.7 and tested against both Python 2.6 and 2.7. Besides the Python Standard Library, python-cybox relies on the following Python libraries:
- lxml - A Pythonic binding for the C libraries libxml2 and libxslt.
- python-dateutil - A library for parsing datetime information.
- importlib (Python 2.6) - Convenience wrappers for
importlib is built into Python 2.7, and is available on PyPI for
Each of these can be installed with
pip or by manually downloading packages
from PyPI. On Windows, you will probably have the most luck using pre-compiled
lxml. On Ubuntu (12.04 or 14.04), you should make sure the
following packages are installed before attempting to compile
If you are unable to use pip, you can also install python-cybox with setuptools. If you don’t already have setuptools installed, please install it before continuing.
- Download and install the dependencies above. Although setuptools will generally install dependencies automatically, installing the dependencies manually beforehand helps distinguish errors in dependency installation from errors in python-cybox installation. Make sure you check to ensure the versions you install are compatible with the version of python-cybox you plan to install.
- Download the desired version of python-cybox from PyPI or the GitHub releases page. The steps below assume you are using the 188.8.131.52 release.
- Extract the downloaded file. This will leave you with a directory named cybox-184.108.40.206.
$ tar -zxf cybox-220.127.116.11.tar.gz $ ls cybox-18.104.22.168 cybox-22.214.171.124.tar.gz
$ unzip cybox-126.96.36.199.zip $ ls cybox-188.8.131.52 cybox-184.108.40.206.zip
- Run the installation script.
$ cd cybox-220.127.116.11 $ python setup.py install
- Test the installation.
$ python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import cybox >>>
If you don’t see an
ImportError, the installation was successful.