= Easy Developer Setup for !SasView 5.0 Using Anaconda =
Note - if you want to be able to build !SasView 5 alongside !SasView 4 and then switch between them, please compare the Sasview 4 instructions, especially "Step 6".
== Step 1 - Install Anaconda ==
Download the latest '''64-Bit''' Python '''3.7''' Installer from https://repo.continuum.io/archive/ (e.g. Anaconda3-2019.03-Windows-x86_64.exe) 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 privileges. If "conda" is not a recognised command then add the install directory to your Windows user Path variable.[[BR]]
* 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 1.2 - Install Microsoft Visual C++ 14 Build Tools (Windows only) ==
Some Python packages installed later require the Microsoft Visual C++ 14 build tools. If not already installed, e.g. by the complete Visual Studio, use [http://go.microsoft.com/fwlink/?LinkId=691126&fixForIE=.exe. this link to download the Visual C++ 2015 Build Tools] directly. That will install Visual C++ 14 without installing Visual Studio. It requires Administrator permissions.
== Step 1.3 - Update conda to the latest version ==
By opening the newly installed 'Anaconda Prompt' and running
{{{
conda update -n base -c defaults conda
}}}
Otherwise, depending on the installed versions, the following error might interrupt the installation of the packages required for SasView:
{{{
ERROR conda.core.link:_execute(507): An error occurred while installing package 'conda-forge::ipykernel-X.Y.Z-py36_0'.
PermissionError(13, 'Permission denied')
}}}
In this case, update conda as shown above, delete the environment folder 'C:\Users\tom\Anaconda3\envs\qt5_win' and try again.
== Step 2 - Download !SasView and sasmodels from github ==
If you don't have git installed, go to the GIT section below ([#anchor1 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 checkout ESS GUI branch ==
Go to folder:
{{{
cd sasview
}}}
and run:
{{{
git checkout ESS_GUI
}}}
== Step 4 - Install dependencies ==
Go to folder:
{{{
sasview/build_tools/
}}}
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 conda_qt5_win.yml
#Mac OSX
conda env create -f conda_qt5_min_osx.yml
#Linux
conda env create -f conda_qt5_min_ubuntu.yml
}}}
=== Other dependencies ===
Note that in order to build the documentation, you will require a version of GNU Make (the `make` command). On Linux, you can obtain this with your package manager. On Windows 7, activate your new conda environment and run the following:
{{{
conda install -c conda-forge make
}}}
On Windows 10, you may find that the `make` command does not work with the above method. You can find a Windows-compatible build of GNU Make here: http://gnuwin32.sourceforge.net/packages/make.htm Ensure that you add the install directory to your PATH.
See further notes at "Step 6" of the !SasView 4 developer notes.
== Step 5 - activate conda enviroment ==
{{{
#Windows
activate qt5_win
else if running from inside a Git Bash shell use:
source activate qt5_ubuntu
#Mac OSX
source activate qt5_osx
#Linux
source activate qt5_ubuntu
}}}
== Step 6 - run !SasView ==
You should be ready to run sasview. Go to sasview directory and run
{{{
#Windows
python run.py
#Mac OSX and Linux
python run.py
To build the documentation you will still first need to do:
python setup.py docs
}}}
== [=#anchor1 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
}}}