Windows quick start guide

To get the PCRaster software up and running please follow the steps outlined below. You will need to configure two packages, a Python environment and the PCRaster software.

There are several Python environments available such as WinPython or Anaconda, or Enthought Canopy. Our experience is that installing PCRaster Python is currently most straightforward with the standard Windows version of Python. Below, we explain the installation of PCRaster Python using IDLE as the Python environment.

1) Installing the Python environment

a) Installing the Python IDLE environment

Go to  Python downloads and download Python 2.7.13, use ‘Download windows x86-64 MSI installer’. After selecting the link, select ‘run the file’, and to customise Python, select ‘Add python.exe to path’, ‘Entire feature will be installed on local harddrive’.

b) Installing the Python NumPy module

After you have installed Python, you need to install the Python NumPy module. On your computer, go to Start, Accessories, Command Prompt. In the black command prompt window, type:

python -m pip install numpy

And press enter to run the command. It will download and install the module.

2) Installing PCRaster

a) Download the required software packages

Download the PCRaster software packages appropriate for your Windows system.

You can download it at:

The downloads for PCRaster should start automatically after a few seconds. If the direct download fails, obtain the necessary file from our SorceForge site.

b) Configure the software packages

Set up the PCRaster package by:

A. Unzipping the PCRaster package

In general, the PCRaster package can be extracted to any location on the hard disk. We recommend to choose a typical location, for example
C:\Program Files
the PCRaster package will then be extracted to
C:\Program Files\pcraster-4.1.0_x86-64
In case you are not allowed to write to the Program Files directory, choose  another location (e.g. D:\). Please check the contents of the folder, it should contain the folders bin, doc, lib, python, and share.

Note: Please write down the path where you extracted the PCRaster package. In the following, we will use the path C:\Program Files\pcraster-4.1.0_x86-64 in our instructions, please use your path instead.

B. Updating the PATH environment variable

The PATH environment variables must be updated such that PCRaster command line applications (a.g. aguila, pcrcalc, mapattr, …) can be executed on the Windows Command Prompt.

The PATH environment variable can be changed on Windows 7 as follows (see here for Windows XP):

  1. Right-click on Start, and then Open Windows Explorer.
  2. Right-click on Computer, then Properties.
  3. In the System Control Panel, click Advanced System Settings.
  4. Click the Advanced tab.
  5. Click Environment Variables.
  6. Be careful with the following two steps, and do not delete or modify one or more of the existing entries (unless you really know what you are doing)
  7. In the User variables section, either select the PATH variable and click edit, or add a new variable and name it PATH
  8. Add the path of the bin directory of the extracted PCRaster package to the Variable value field, e.g.
    C:\Program Files\pcraster-4.1.0_x86-64\bin;
    Add the path at the beginning of the field. Note the extra semicolon at the end, it is required to separate various entries. Do not add spaces around the semicolon.

C. Updating the PYTHONPATH environment variable

To use the PCRaster Python module you need to update the PYTHONPATH environment variable. Continue with (or perform steps B1- B6)

  1. In the User variables section, either select the PYTHONPATH variable and click edit, or add a new variable and name it PYTHONPATH
  2. Add the path of the python directory of the extracted PCRaster package to the Variable value field, e.g.
    C:\Program Files\pcraster-4.1.0_x86-64\python;
    Add the path at the beginning of the field. Note the extra semicolon at the end, it is required to separate various entries. Do not add spaces around the semicolon.

Click ok to confirm your modifications.

3) Test your setup

Note: you need to start a new command prompt or to restart IDLE, the new environment variables will not affect open command prompts or IDLE sessions.

A. Testing the PCRaster command line applications

Click on Start and type cmd in the Search programs and files to start the Windows Command Prompt. Type:
pcrcalc
You should see a message similar to:
pcrcalc Nov  5 2014 (win64/msvc)
USAGE: pcrcalc [options] "expression"
or     pcrcalc [options] -f scriptFile
( or #!: pcrcalc -F [options]+)
other flags:
s #  : set seed (integer > 0) for random generator
default is based on current time
b f  : overrule script bindings
1    : update timeseries files at end of each timestep
r f  : set run directory
d f  : debug mode, check MV creation on assignment
comparing against clone or areamap boolean mask
c    : strict Case significant filename check (Unix portability)
p    : print profile information
m    : optimize with areamap MV compression
l    : use less memory but more temporary disk storage
t    : test argument substitution

B. Testing the PCRaster Python module

Start IDLE and type

from pcraster import *

and press enter. When no message appears you can start building your models with PCRaster.

Questions?

Please post questions regarding installation, applications or operations of the PCRaster package on our mailing list.