Easy Developer Setup on Windows Using Anaconda

Current Issues

  • For now this is Windows only, though you may try other operating systems if you're happy to use the current versions of all packages.
  • OpenMP is not included in the version of MinGW bundled with Anaconda. Either turn OpenMP off when building (see below), or download your own version of MinGW for now.

Step 1 - Install Anaconda

Download the latest Windows 32-Bit Python 2.7 Installer from http://continuum.io/downloads and run it.

  • The recommended destination folder is as good as any. If you deviate from this then it's probably worthwhile to make sure the path is short and contains no spaces.
  • At the Advanced Options screen, you need to consider whether or not you want to make Anaconda your default version of Python. Developers who do not work on multiple Python projects can just accept the defaults here.

Step 2 - Install Dependencies

Add the channel containing extra dependencies needed by SasView:

conda config --add channels https://conda.binstar.org/PeterParker

If you are behind a proxy, you need to tell Conda about it. Add the following to your .condarc file which is at C:/Users/YourUserName/.condarc:

# This example should work for the proxy at RAL:
    http: http://wwwcache.rl.ac.uk:8080
    https: http://wwwcache.rl.ac.uk:8080

Install all required SasView dependencies:

conda install --yes pylint matplotlib scipy pyparsing html5lib wxpython reportlab lxml PIL setuptools numpy comtypes pywin32 py2exe pisa numpy sphinx unittest-xml-reporting mingw pip h5py

At least one additional package is required (compare the 64 bit Windows instructions).

conda install xhtml2pdf
pip install xhtml2pdf

The conda install above will fail to find 32 bit xhtml2pdf, but will install the dependencies it needs, xhtml2pdf needs pip install for its 32 bit version. The bumps and periodictable Anaconda packages are not up to date. To install the latest versions, use pip as below, or checkout the repositories as outlined in Step 5.

pip install bumps periodictable

To force installation of a specific version of these packages (here bumps- use:

pip install bumps==

Note: if attempting to upgrade older versions of bumps and/or periodictable, first uninstall any versions already installed.

pip uninstall bumps
pip uninstall periodictable

You may need to issue these commands more than once to ensure that all previous versions are cleaned out.

Step 3 - Install Git (or optionally stay with SVN)


Download: http://git-scm.com/download/win

When installing, it may be worthwhile to make sure "Use Git from the Windows Command Prompt" is selected, rather than "Use Git from Bash only". This way you can use git from the same command line as you will use Anaconda.

Set up your credentials:

git config --global user.name "John Doe"
git config --global user.email johndoe@example.com


Download: http://sourceforge.net/projects/win32svn/files/latest/download

Step 4 - Download the SasView and SasModels Source Code

The SasView source code requires the sasmodels source directory to be in the same base directory for proper referencing. The dependencies also require the directories be named sasview and sasmodels.

# With Git:
git clone https://github.com/SasView/sasview.git sasview
git clone https://github.com/SasView/sasmodels.git sasmodels
# With SVN:
svn checkout https://github.com/SasView/sasview sasview
svn checkout https://github.com/SasView/sasmodels sasmodels
cd sasview

Step 5 - Download the Optimiser Package & Periodic Table Package

Added by smk78

Follow this step to use the source code rather than installed packages for bumps and periodictable.

# With Git:
git clone https://github.com/bumps/bumps.git bumps
git clone https://github.com/pkienzle/periodictable.git periodictable
# With SVN:
svn checkout https://github.com/bumps/bumps.git bumps
svn checkout https://github.com/pkienzle/periodictable.git periodictable

Step 6 - Check that the Right Version of Python is Being Used

Ask your console which versions of Python it can find:

where python

Hopefully, the first python installation in the list is the recently-installed Anaconda version. If not, you have two options:

  1. Whenever you call python on the command line from now on, use the fully resolved path, e.g.:
  1. Reorder your PATH/Path environment variables so that the Anaconda installation of Python appears BEFORE all the others. Environment variables can be modified by pressing the windows key, typing "edit the system environment variables" and hitting Enter. The built-in Windows way of doing this is not very nice. An easier way to edit environment variables is by installing RapidEE.

Some things to consider:

  • Installations of McStas might cause problems. If the installation of Python that comes bundled with McStas appears in the PATH before Anaconda, then the solution is the same as above.
  • Installations of Mantid *should* play nice with Anaconda. Let somebody know if it's causing a problem, though again, just make sure your PATH gives preferential treatment to Anaconda.
  • If you have an old SasView development environment set up, then you may have an installation of Python2.6 that doesn't play nice with Anaconda. Uninstall it using the Control Panel and it should clear everything up.

Step 7 - Install the Optimiser Package & Periodic Table Package

Added by smk78

Only follow this step if you chose to clone the bumps & periodictable repositories in Step 5 rather than pip install them in Step 2.

Navigate to the bumps folder:

python setup.py install

Navigate to the periodictable folder:

python setup.py clean

Step 8 - Build SasView

Navigate to the sasview-code folder. Optionally check that you have everything by:

python check_packages.py

Compile the code:

python setup.py disable_openmp build -cmingw32

This may end up failing with a large, obscure-looking "...failed with exit status 1" error, which when you scroll up actually ends up being "The command line is too long."

If so, there are a couple of things you can try. First, make sure the C:/AnacondaInstallDir/MinGW/bin folder is at the beginning of your Path environment variable. If that doesn't cure the problem you will need to shorten folder path names (by actually renaming your working folders, or even by moving MinGW out of the Anaconda tree altogether - in which case remember to change your Path environment variable accordingly). Alternatively try adding the command switch -t t after the -cmingw32.

Step 9 - Run SasView from the Code

You should then be able to run SasView “in-place” from the code, using:

python run.py

Step 10 - Building the Help Docs

The process for building the help docs has been steadily evolving. The latest instructions might be found here

Last modified 3 years ago Last modified on Oct 30, 2017 11:28:33 AM