Skip to content

Installation Guide

There are two methods for local installation in virtual environments: Docker or Conda + pip.

Installation without a virtual environment may have unexpected/unresolvable conflicts, and is not supported.

Docker

Requirements

  1. Download and install docker

  2. Open Terminal or PowerShell and run:

    git clone https://github.com/CancerDataAggregator/cda-python.git
    

  3. Navigate to the cda-python folder:

    cd cda-python
    

  4. Build the docker container:

    docker-compose up --build
    

  5. Open a Browser to http://localhost:8888. This will open a docker container with all the required packages for using the API in ipython notebook.

Notes

  • To stop the container from running, return to the terminal window (from step 2), and type Control C to stop the container.

Notes

To delete the container from your machine, use this command in the cda-python project directory.

docker compose down

Conda + Pip install

Requirements

  1. Open Terminal or PowerShell and create a new conda environment:

    conda create -n cda python=3.7
    
    type y when prompted

  2. Activate the environment:

    conda activate cda
    conda install jupyter
    pip install git+https://github.com/CancerDataAggregator/cda-python.git
    cd cda-python
    jupyter notebook
    
    type y when prompted

  3. Click on the folder called notebooks, then the file called example.ipynb to open the example workflow, or create a new notebook to run your own.

Notes

You only need to create a new conda environment once!

  • To exit the conda environment, return to the terminal window (from step 1), and type Control C to stop the notebook then:
    conda deactivate
    
  • To return to the notebook in conda, open a terminal and type:
    conda activate cda
    jupyter notebooks
    

Customizing your cda-python installation

Modifying the localhost port in Docker

By default, both Docker and ipython notebook use port 8888. To use both simultaneously, change the Docker port:

  1. Navigate to the cda-python folder

  2. Use a plain text editor (bbedit, textedit, vim, nano, emacs) to open the hidden file .env

  3. Edit line 4 to a different port:

    NOTEBOOK_PORT = 8889
    

  4. Rebuild docker container:
    docker-compose up --build
    

Last update: 2022-06-15
Back to top