Version 25 (modified by richardh, 5 months ago) (diff)

Easy Developer Setup Using Anaconda

Step 1 - Install Anaconda

Download the latest 64-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, and is not the same as any previous installation (one reader installed 64 bit on top of previous 32 bit, not a good idea).
  • 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.
  • By default of Windows anaconda is installed for single user and not "everyone", which means you cannot run the conda command from an arbitrary command window. If you proceeded with default installation, you need to open Anaconda Prompt from Menu Start. Otherwise you can install anaconda for everyone, which requires root privlidges. If "conda" is not a recognised command then add the install directory to your Windows user Path variable.
  • If you have a failing reference to a "conda.binstar.org/PeterParker/win-64/repodata.json" file, then edit this out of the anaconda start up file at users/username/.condarc as you may still have left it there from an older sasview installation system.

Step 2 - Download SasView and sasmodels from github

If you don't have git installed, go to the GIT section below (Step 7) for instructions, otherwise simply run

git clone https://github.com/SasView/sasview.git sasview
git clone https://github.com/SasView/sasmodels.git sasmodels

Step 3 - Install dependencies using yml files

Go to folder:

sasview/build_tools/conda/ymls

and create conda enviroment using yml specific for your platform (needs to be run from top-level not within a conda virtual environment)

#Windows
conda env create -f sasview-env-build_win.yml

#Mac OSX
conda env create -f sasview-env-build_osx.yml

#Linux
conda env create -f sasview-env-build_linux.yml

Step 4 - activate conda enviroment

#Windows
activate sasview

else if running from inside a Git Bash shell then use: source activate sasview.

#Mac OSX and Linux
source activate sasview

Step 5 - run SasView

You should be ready to run sasview. Go to sasview directory and run

#Windows
python run.py

#Mac OSX and Linux
pythonw run.py

To build the documentation you will still first need to do:

python setup.py docs 

Step 6 - try the new qt gui (work in progress)

Some notes, updated 5th June 2018, based on a Windows 7 install. Start with Git bash in your sasview directory.

source deactivate

git checkout ESS_GUI

Look for sasview/build_tools/conda_py3_qt5_env.yml, open it in an editor, save it somewhere else outside of git control, remove in the pip section the lines for sasview and sasmodels, then add there - tinycc==1.1 the compiler for the models.

[Note - if later whilst running sasview you have problems with models not compiling or loading, close sasview, delete the contents of the directory users/your-user-name/sasmodels/compiled_models, then re-start, which will force re-compilation using the current compiler.]

conda env create -f=/path-to-your-new-yml-file/conda_py3_qt5_env_new.yml

source activate qt5

cd src/sas/qtgui

python convertUI.py

cd ../../..

python run.py

If run.py gives an error from line 1140 in readCategoryInfo, you likely have the old version of the categories file. Delete the file serial_cat.json from your user directory  ( c:/users/username/.sasview in Windows) and then run the latest *release* version of sasview. This will automatically generate the correct categories.json file.

You may then need to install 64 bit Microsoft Visual C++ 14.0 compiler by following the link requested, as the latest changes to use only TinyCC compiler are not yet merged with this branch. Other useful conda commands:

conda info —envs will show that you now have both sasview and qt5 environments.

conda env remove —name qt5

will remove the qt5 environment, though the files involved seem to stay on your hard drive so a new conda env create is much faster than the first time.

if something fails part way through creating an environment, such as not removing the pip install for sasview & sasmodels, then "update" will be faster e.g.

conda env update -f=/path to your new yml file/conda_py3_qt5_env_new.yml —name qt5

If it does not work the first time through, try going back to the normal sasview master, then repeat the steps above. Piotr and others will be making this easier in the future.

Step 7 - Install Git (Optional)

Install Git for your platform by following instructions:

https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

When installing on Windows, 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

If you work behind proxy remmber to configure

e.g. git config --global http.proxy 192.168.1.1:XXXX