Skip to content

DevNotes_CondaDevEnviroment

Steve K edited this page Sep 20, 2023 · 29 revisions

Example for setting up developers environment using pip and conda.

Note 1: This assumes that you have anaconda and git installed

Note 2: All commands should be executed from terminal (Terminal on OSX and Linux and Anaconda Prompt on Windows)

Note 3: The conda environment itself can be updated with the command

conda update --all

Setup conda environment:

conda create -n sasview_dev python=3.9

NB: (Sep 2023) We are starting to transition to Python 3.11. If building a conda environment with this, be aware that some of the pinning of dependencies in requirements.txt below may fail. In this instance, pip install each individually.

Activate the environment

conda activate sasview_dev

Clone sasview, sasdata, and sasmodels repositories

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

Go to sasview folder and install dependencies:

pip install -r build_tools/requirements.txt

and, if you want GPU support

pip install pyopencl

Install sasdata, sasmodels, and sasview

Navigate to sasdata, sasmodels, and sasview folders (separately) and run:

python setup.py install 

Navigate to the sasview folder and run:

python run.py

If you already have an (old) environment and want to refresh it...

First, deactivate the environment

conda deactivate

This should drop you into the base environment. Then remove the required environment

conda remove --name ENV_NAME --all

For good measure then navigate to your Anaconda installation folder and the \envs subfolder. Delete any folder in there matching the environment you just removed.

Decide if you want to update conda itself (see Note 3 above).

Then proceed to set up a new environment.

Clone this wiki locally