Skip to content

1. Set up and deploy CROP locally or on Azure

Flora edited this page May 18, 2021 · 1 revision

Prepare the files

  1. Download the Crop Repository to your local machine or VM.

  2. Download the CROP_unity_js Repository to get the 3D model (optional).

  3. Copy the contents of the CROP_unity_js repository and paste them within the downloaded CROP project inside the CROP\webapp\app\base\static\structures\CROP_unity_js folder (optional).

  4. Navigate to the CROP.secrets folder and create a copy of the template_crop.sh (for mac) or the template_crop_windows.sh (for windows). Rename it to crop.sh.

Set up the environmental variables

  1. Open the crop.sh in an editor such as notepad and replace the python path with the path to your CROP folder and the <<> with the appropriate passwords and keys as set up or given to you.

  2. Save the crop.sh and run it as an administrator to save the environmental variables. Make sure that the env variables are saved ok.

Set up Python

  1. Install Python v. 3.7 or higher.

  2. Create a new Python environment (e.g. if you are using conda type conda create --name cropenv ).

  3. Activate your new virtual environment. e.g. conda activate cropenv.

  4. cd to the directory where requirements.txt is located.

  5. Install the requirements from the requirements.txt file. To do that run: pip install -r requirements.txt in your shell. You can check if all the requirements are installed properly using the command pip freeze and compare the list to the requirements.txt.

Run the webapp

  1. cd to the CROP\webapp directory

  2. Run flask using: flask run --host=0.0.0.0 --port 5000

  3. open your browser and call the local host e.g. http://localhost:5000/ to view the webapp

Clone this wiki locally