Version 23 (modified by smk78, 10 years ago) (diff)

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 Dependancies

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:
proxy_servers:
    http: http://wwwcache.rl.ac.uk:8080
    https: http://wwwcache.rl.ac.uk:8080

Install all the SasView? dependencies we need:

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

NB: mingw can be removed from the command line above if you have a separate MinGW installation.

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

Git

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

SVN

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

Step 4 - Download the SasView? Source Code

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

Step 5 - Download the Optimiser Package & Periodic Table Package

Added by smk78

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

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.:
    C:/PathToAnaconda/python
    
  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

Navigate to the bumps-code folder:

python setup.py install

Navigate to the periodictable-code folder:

python setup.py install

Step 8 - Build SasView?

Navigate to the sasview-code folder:

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, then make sure the C:/AnacondaInstallDir/MinGW/bin folder is at the beginning of your Path environment variable.

Step 9 - Run SasView? from the Code

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

python run.py