How to run an Anaconda/Miniconda Python stack on


To run Anaconda (the full data science Python stack) or Miniconda (just the Python package manager) on


You will need:

Problems offers several different versions of Python by default, but some applications require different environments, such as data science applications running on the Anaconda stack or packages installed with Miniconda. Running the Anaconda/Miniconda installer in the build hook of a application allows for the activation of conda virtual environments for script execution.


1. Set git remote to project

$ git init
$ platform project:set-remote <project id>

2. Create an installation script file

The build hook runs Dash, not Bash, so the installation script is executed separately in


# Download an Anaconda3 release and name the file ``

curl -o

# If you wish to install Miniconda3 instead, comment out the line above and uncomment the line below:
# curl -o

# Run the downloaded `` script using bash
# — Use the `-b` flag to run the installer in batch mode
# — Use the `-p` flag to specify where the package manager will actually be installed
bash -b -p $PLATFORM_APP_DIR/conda

# Source the following `` file to put the `conda` command in our path for the duration of this script
. /app/conda/etc/profile.d/

# Add the above command to `.bash_profile` so that it is available during SSH sessions
echo ". /app/conda/etc/profile.d/" >> ~/.bash_profile
echo "conda activate" >> ~/.bash_profile

# Enter the base conda environment and prepare to configure it
conda activate base

# Update conda itself
conda update -n base -c defaults conda

# OPTIONAL: Print out debugging information in the build hook
conda info

3. Add a start script for running scripts with Anaconda


# Source the `` file to make this particular shell session able to run the `conda` command
. /app/conda/etc/profile.d/

# Activate the conda environment that was created in the build hook
conda activate base

# Put any commands needed to run a web app here

Make sure to put any commands needed to run a web app at the end of this file.

4. Add

Create the configuration file:

# The name of this app. Must be unique within a project.
name: app

# The runtime the application uses.
type: "python:3.7"

# The hooks executed at various points in the lifecycle of the application.
    build: |
      set -e

      # The build hook uses `dash` rather than `bash`.
      # Thus, the installation occurs in separate script that runs with `bash`.

    deploy: |
      set -e

      # Make the start script executable
      chmod +x

# The size of the persistent disk of the application (in MB).
disk: 1024

# The configuration of app when it is exposed to the web.
        start: bash ./
        socket_family: tcp
        protocol: http
            passthru: true

5. Define routes


    type: upstream
    upstream: app:http

6. Add empty services


# empty

7. Add, commit, and push these files to your project

git add .
git commit -m "Adding configuration to install conda environment"
git push platform master


By executing the Anaconda or Miniconda installation Bash scripts in the build hook, a project is able to install an Conda-based execution environment on