SWAN comes with a default set of code libraries.
You can import and install additional code libraries in supported languages in a notebook to meet different research needs.
For example, in Python you can add spaCy for natural language data processing and NumPy for time series data processing. In R you can add ggplot2 for visualising data and dplyr for categorised data processing.
SWAN uses libraries built into CernVM File System (CVMFS), specifically LCG97python3 on x86_64-centos7-gcc8-opt platform. A list of installed packages can be found here.
Add a new library
CloudStor SWAN is a shared environment. Code libraries must be installed in your local SWAN home folder (/scratch).
If you receive a read-only file system error, you have attempted to install your package or libraries over the top of the pre-installed environment. Please ensure you are installing them in your home folder.
If you believe that the libraries are useful for others and are common, please contact the CloudStor team and we may include it in SWAN.
PYTHON
Run the following code in your notebook:
!pip install xarray
Where xarray
is the name of the missing library.
R
Run the following code in your Notebook:
#create a local folder for the local files to live in
#[Creates a folder call "R" in your CloudStor home] dir.create('/scratch/R', showWarnings = FALSE) #add the local folder to R's .libPaths(new='/scratch/R') #install a package (zip) locally install.packages("zip", lib="/scratch/R") #import the lib (zip) library(zip, lib="/scratch/R")
Where zip
is the missing library.