Basic Installation

Hazelbean can be installed using condaforge following these steps.

  1. Install git: https://Git-scm.com/downloads
  2. Install Miniforge3 from https://conda-forge.org/download/
    • Install just for your User Account
    • During installation, select yes for “Add Mambaforge/Miniforge to my PATH environment Variable”
  3. Create a new conda environment, activate it, and then install required packages with the following 3 mamba commands. The third command will take quite a while (10+ minutes).
    1. mamba init
    2. mamba create -n environment_name
    3. mamba activate environment_name
    4. mamba install hazelbean

You can now import hazelbean and it will have precompiled binaries already working for your operating system for geospatial operations using ProjectFlow!

Repository Installation

If you want to run SEALS, edit hazelbean, or run our global_invest models, you will need to have a C compiler and have editable installs of our git repositories. First, do the basic installation above and then follow these steps:

  1. Install C/C++ compiler
    1. Windows: - Option 1: You could go to https://visualstudio.microsoft.com/visual-cpp-build-tools/ and select download build tools. - Option 2: Enter the following command in the Terminal: winget install Microsoft.VisualStudio.2022.BuildTools --force --override "--passive --wait --add Microsoft.VisualStudio.Workload.VCTools;includeRecommended" This will launch the build-tools installer (you could do this manually via the MS website if you want, but this ensures you get the right tools). - Option 3: Run the install.bat file in the Earth Economy Devestack repo’s root. This just runs the winget command above. - Mac:
    2. Mac/Linux
      1. You can use Xcode to compile the cython files. Most users will already have this installed but if not, follow the directions below.
        • If you don’t have Xcode, you can get it by running xcode-select --install in the Terminal. This command downloads and installs the Xcode Command Line Tools, which includes gcc and clang, the compilers needed to compile C/C++ code on macOS. This is somewhat analogous to the Visual Studio Build Tools on Windows.
  2. Clone all desired repositories
  3. Install the cloned repositories using an “editable” install with pip
    • Activate the conda environment in this command prompt with the following command
      • mamba activate environment_name
    • Remove from your environment any previously installed devstack software, INCLUDING HAZELBEAN. It is still necessary to install hazelbean as a first step from the Basic install steps above to get all required dependencies.
      • With your environment activated, run e.g. pip uninstall hazelbean or similar for other previously installed models.
    • Navigate in you command prompt to the directory where you cloned the additional repos. For the SEALS example, this would be C:\Users\jajohns\Files\seals\seals_dev
    • Use pip to install the repo you as an “editable install” with the following command
      • pip install -e .

One installed, the cloned repositories are all importable by python. For SEALS, you might want to start by poking around run_seals_standard.py.

Common problems:

  • You MUST have administrator rights to your computer.

  • If you’re using Windows PowerShell (instead of the Command Prompt and it isn’t working with Conda, you must initialize conda in powershell

    • conda init powershell
  • If you don’t add conda to your path, you can do this manually. On PC, you could use the command

    • SETX PATH "%PATH%;C:\Users\<YOUR_USERNAME>\miniforge3;C:\Users\<YOUR_USERNAME>\miniforge3;"
    • (you can do for All Users, but you will need to manually set paths to conda)
      1. If you have an Apple “m1 or m2” chip (a relatively new apple chip, make sure you select the Apple Silicon option). - Install in C:\Users\<YOUR_USERNAME>\miniforge3 (PC) or ~/miniconda3 (Mac)
  • If you get a “Windows Protected your PC”, click more info then Run Anyway.