Abstract
This document explains how to install dependencies for the sjSDM package.
The r sjSDM::install_sjSDM()
function can install
automatically all necessary ‘python’ dependencies but it can fail
sometimes because of individual system settings or if other
‘python’/‘conda’ installations get into the way.
A few notes before you start with the installation (skip this point if you do not know conda):
Sometimes the automatic ‘miniconda’ installation (via
r sjSDM::install_sjSDM()
).doesn’t work because of white
spaces in the user’s name. But you can easily download and install
‘conda’ on your own:
Download and install the latest ‘conda’ version
Afterwards run:
install_sjSDM(version = c("gpu")) # or "cpu" if you do not have a proper gpu device
Reload the package and run the example, if this doesn’t work:
Download and install the latest ‘conda’ version
Open the command window (cmd.exe - hit windows key + r and write cmd)
Run in cmd.exe:
conda create --name r-sjsdm python=3.7
conda activate r-sjsdm
conda install pytorch torchvision cpuonly -c pytorch # cpu
conda install pytorch torchvision cudatoolkit=11.3 -c pytorch #gpu
python -m pip install pyro-ppl torch_optimizer madgrad
Restart R, try to run the example, and if this doesn’t work:
Run in R:
install_sjSDM(version = c("gpu")) # or "cpu" if you do not have a proper gpu device
Restart R try to run the example, if this doesn’t work:
We strongly advise to use a ‘conda’ environment but a virtual environment should also work. The only requirement is that it is named ‘r-sjsdm’
Download and install the latest ‘conda’ version
Open your terminal and run:
conda create --name r-sjsdm python=3.7
conda activate r-sjsdm
conda install pytorch torchvision cpuonly -c pytorch # cpu
conda install pytorch torchvision cudatoolkit=11.3 -c pytorch #gpu
python -m pip install pyro-ppl torch_optimizer madgrad
Restart R try to run the example, if this doesn’t work:
Run in R:
install_sjSDM()
Restart R try to run the example, if this doesn’t work:
We strongly advise to use a ‘conda’ environment but a virtual environment should also work. The only requirement is that it is named ‘r-sjsdm’
Download and install the latest conda conda version
Open your terminal and run:
conda create --name r-sjsdm python=3.7
conda activate r-sjsdm
python -m pip install torch torchvision torchaudio
python -m pip install pyro-ppl torch_optimizer madgrad
Restart R try to run the example, if this doesn’t work:
r sjSDM::install_diagnostic()
as a quote.library(sjSDM)
<- simulate_SDM(sites = 100, species = 10, env = 5)
community <- community$env_weights
Env <- community$response
Occ
<- sjSDM(Y = Occ, env = linear(Env, ~0+X1*X2 + X3 + X4))
model summary(model)