Package InstallationΒΆ
Most users will be able to install the MSWH Python package by following the Setup and Installation and Simple Installation Using Conda section of the README.md file that is displayed at the landing page of the MSWH repository. Please use those instructions as the primary approach to MSWH package installation.
The set of instructions presented here is intended for technical users that are relatively new to virtual environments or Python in general, for users who encountered issues with the simple installation instructions available in the README.md file, or any other users looking for a reminder on some of the installation steps. These instructions also show to the users how to utilize an alternative Python package management system, venv.
Please make sure to install pip and, in case you are not using venv, conda as instructed
in Setup and Installation on the readme file.
Here are the detailed steps to install the MSWH Python package:
Since the repo comes with database files, please download, install and see the documentation for git large file storage.
It is recommended to create a new
Pythonenvironment in order to avoid interference with the system-wide Python installation, for example by using conda or venv. Depending on the approach you take, pick one of the commands below and run it in a terminal to create a new environment named, for instance,mswh.If you use
condafrom the repo clone folder run:conda create -n mswh python=3.8If you use
venv, for example onLinux:python3.8 -m venv <path_to_env>/mswhWith
<path_to_env>as your selected folder path to store virtual environments.Now the virtual environment needs to be activated, by running one of the following commands:
When using
AnacondaorMiniconda:conda activate mswhWhen using
venv:source <path_to_env>/mswh/bin/activateAfter having activated the virtual environment, the name of it should appear before the prompt in the terminal.
For deactivating use:
conda deactivateTo make use of example
Jupyter notebooksone should have JupyterLab installed. To ensure the same Python kernel can be used in aJupyter notebook, activate the virtual environment and run:python -m ipykernel install --user --name mswhUsers with admin privileges can skip the
--userflag.If you have any issues with plots not being displayed when running the example notebooks, please install the following:
jupyter labextension install jupyterlab-plotlyClone the repository with:
git clone https://github.com/LBNL-ETA/MSWH.gitTo install the necessary Python packages navigate to the
setup.pydirectory and run:pip install -e .The
-eflag is only necessary if one would like changes to the source code be reflected immediately (without having to rerun thesetup.pyscript with every change to the source code). If you just want to run the project application, you can omit the-eflag.To use the plotting capabilities, also required when running tests, please install orca.