how to install python quantlib windows

Here we’ll show two ways to install quantlib package for python under windows [under unix/linux just install quantlib-python package from your favorite package installer]

first way (somewhat lengthy) is to compile it youself
second and easy way is install it from winpython package (see below)

Compile and install

you’ll need visual studio 2008 because python is compiled with it

install python 2.7

download quantlib 

download quantlib-swig (can be for linux distribution, for example for debian)

download boost 1.47 version is ok

extract all this to directory without spaces in name [there’s a bug in python script if ther’re spaces

modify enviroment variables:

INCLUDE = path to boost

QL_DIR = path to quantlib

build quantlib

go to swig/python dir

execute:

python setup.py build --compiler=msvc

python setup.py install

if you have several visual studio installations (VS 2012 and VS 2008 for example) you’ll need to run this from visual studio command promt (and indicating full path to python.exe)

Easy way with WinPython

install WinPython

download Quantlib package for your platform from here

run winpython control panel .exe
and point to downloaded quantlib package , Install

to use QuantLib run

from QuantLib import *

Posted in quantlib