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
- git (Install)
- terminal/command line
-
Open Terminal or PowerShell and run:
git clone https://github.com/CancerDataAggregator/cda-python.git
-
Navigate to the cda-python folder:
cd cda-python
-
Build the docker container:
docker-compose up --build
-
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¶
-
Open Terminal or PowerShell and create a new conda environment:
typeconda create -n cda python=3.7
y
when prompted -
Activate the environment:
typeconda activate cda conda install jupyter pip install git+https://github.com/CancerDataAggregator/cda-python.git cd cda-python jupyter notebook
y
when prompted -
Click on the folder called
notebooks
, then the file calledexample.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:
-
Navigate to the cda-python folder
-
Use a plain text editor (bbedit, textedit, vim, nano, emacs) to open the hidden file
.env
-
Edit line 4 to a different port:
NOTEBOOK_PORT = 8889
- Rebuild docker container:
docker-compose up --build