In which I run through setting up a Python environment on Windows...
I'm going to preface this post by saying I'm not breaking any new ground here. As is often the case, though, a beginner wanting to set-up an environment to do this will have to go to multiple websites to collect this info so I'm going to distil it into one post.
I am going to talk about Python 2.7 as currently it has the most support for libraries. This method should work equally well for Python 3 but I have not tested this.
Install Python and GUI
You will now have a working Python environment that will run from command line. The standard install also includes a basic Python GUI that will be available through the Python folder in the Start Menu. If you wish to install a full Python IDE go ahead and install PyDev which is an add-in for the popular and free Eclipse IDE.
Install NumPy and SciPy
- Ensure you have the Python C++ re-distributable installed.
- Install NumPy and SciPy using pip: pip install numpy and pip install scipy
- Type import numpy followed by import scipy at a Python prompt. These should return a blank prompt if there are no errors.*
You should now have all the pre-reqs for installing Bayesian Python libraries. If you want to use the built-in Python installer though "you're gonna have a bad time." You need a Fortran compiler and Windows doesn't come with one as standard.
*If you install nose (pip install nose) you can also run numpy.test() and scipy.test() to get fuller results about your install.
The solution to your Fortran compiler woes is to set-up Cygwin. While you are at it you might as well add all the standard linux commands to your Path in Windows.
- Grab Cygwin and run the installer.
- Leave all the default packages selected.†
- Go to Devel and select the mingw-gcc-fortran package.‡
- Go to Control Panel\System and Security\System.
- Click on Advanced System Settings.
- Click on Environment Variables.
- Edit the path and add C:\cygwin64\bin to the end (use a semicolon to separate entries).
†You can always run the set-up again to install additional packages at a later date.
‡You might as well install the other compilers you are likely to need like GCC while you're at it.
Installing Bayesian Packages
Currently the dependency h5py needs to installed from a pre-compiled binary on windows.
- Install h5py for your version of Windows.
Running pip install bayespy should now work like a charm.
If you aren't fussed about ensuring the pip works on your machine you can download individual packages that have been pre-compiled for Windows.
 Patil A, Fonnesbeck CJ (2010). PyMC: Bayesian Stochastic Modelling in Python. J Stat Softw 35: 1.
 Downey, AB (2012). Think Bayes. Needham: Green Tea Press.