Installation (Windows)
Download Conda
Hint
This step can be skipped if a python distribution and package manager is already installed.
First, a python distribution and package manager is required. For windows, we suggest Miniconda, a lightweight variant of the popular Anaconda distribution. To install Miniconda, follow the installation instructions.
Virtual Environment
It is highly recommended to install LIFEsim in a virtual environment. This ensures installed packages and changes made do not affect other projects on a system. The steps of creating a virtual environment with conda are described in the following.
First, open the Conda Prompt, navigate to where you want to create the virtual environment and type
> conda create --name new_folder python=3.8
Note that we specify the required python version in this command. Some conda commands will ask for confirmation, which can be affirmed by typing.
Proceed ([y]/n)?
> y
A virtual environment in the folder new_folder is created in the current directory
Hint
You might need to deactivate the conda base
> conda deactivate
To activate and deactivate your new virtual environment use the following commands respectively
> conda activate new_folder\
Check the python version with the following command
> python --version
> conda deactivate
Download from PyPI (Recommended)
Hint
You will likely need to install git first
> conda install git
With the new environment activated, install LIFEsim via pip.
> pip install LIFEsim
LIFEsim need a modified version of the package SpectRes to run. It can also be installed using pip. Run
> pip install git+https://github.com/fdannert/SpectRes.git
Download from Github
Navigate to the directory in which you desire to place the LIFEsim repository. Then clone the repository from Github by executing
> git clone https://github.com/fdannert/LIFEsim.git
Hint
If git is not installed on your system run
> conda install git
The dependencies required by LIFEsim can be installed with
> conda install --file requirements.txt
Important
LIFEsim need a modified version of the package SpectRes to run. Please install it via the following procedure.
First, make sure that you are in the directory where you want to install SpectRes. Then run
> git clone https://github.com/fdannert/SpectRes.git
The last step is point the Python install of your virtual environment to LIFEsim and SpectRes.
To do so, please navigate to site-packages folder of your virtual environment, most likely
located in `` C:Usersuser_nameminiconda3envsnew_folderLibsite-packages``. In this directory,
create the file lifesim.pth containing the paths to LIFEsim and SpectRes separated by a new
line
C:\path_to_LIFEsim\LIFEsim\
C:\path_to_SpectRes\SpectRes\
Testing the Installation
To test the installation, open a new conda prompt and activate the virtual environment as above. Then open Python and import LIFEsim with
> python
>>> import lifesim
If the import statement executes, the installation has been successful. As an extra test run
>>> lifesim.util.constants.c
299792000.0
This should return the speed of light in [m s \(^{-1}\) ].
Hint
If the import lifesim command fails, the reason is likely that the the PYTHONPATH
is not set correctly. To check for this please run in Python (started with the virtual
environment active as above)
>>> import sys
>>> sys.path
If the path to LIFEsim 'C:\path_to_LIFEsim\LIFEsim\' is not returned this is likely the
source of the issue.
The same test can be performed if SpectRes does not import.