Version: 2.5.0

Installation

The installation of stix-validator can be accomplished through a few different work flows.

Dependencies

The stix-validator package relies on some non-standard Python libraries for the processing of XML content. Revisions of stix-validator may depend on particular versions of dependencies to function correctly. These versions are detailed within the distutils setup.py installation script.

The following libraries are required to use stix-validator:

  • lxml - A Pythonic binding for the C libraries libxml2 and libxslt.
  • xlrd - A library for parsing Microsoft Excel documents
  • ordereddict - A drop-in replacement for collections.OrderedDict, which is not available in Python 2.6.

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 binaries for lxml. On Ubuntu (12.04 or 14.04), you should make sure the following packages are installed before attempting to compile lxml from source:

  • libxml2-dev
  • libxslt1-dev
  • zlib1g-dev

Warning

Users have encountered errors with versions of libxml2 (a dependency of lxml) prior to version 2.9.1. The default version of libxml2 provided on Ubuntu 12.04 is currently 2.7.8. Users are encouraged to u pgrade libxml2 manually if they have any issues. Ubuntu 14.04 provides libxml2 version 2.9.1.

Manual Installation

If you are unable to use pip, you can also install python-stix with setuptools. If you don’t already have setuptools installed, please install it before continuing.

  1. 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 stix installation. Make sure you check to ensure the versions you install are compatible with the version of stix you plan to install.
  2. Download the desired version of stix from PyPI or the GitHub releases page. The steps below assume you are using the 2.5.0 release.
  3. Extract the downloaded file. This will leave you with a directory named stix-validator-2.5.0.
$ tar -zxf stix-validator-2.5.0.tar.gz
$ ls
stix-validator-2.5.0 stix-validator-2.5.0.tar.gz

OR

$ unzip stix-validator-2.5.0.zip
$ ls
stix-validator-2.5.0 stix-validator-2.5.0.zip
  1. Run the installation script.
$ cd stix-validator-2.5.0
$ python setup.py install
  1. Test the installation.
$ python
Python 2.7.8 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sdv
>>> print sdv.__version__
2.5.0

If you don’t see an ImportError, the installation was successful.

Further Information

If you’re new to installing Python packages, you can learn more at the Python Packaging User Guide, specifically the Installing Python Packages section.