Extended Installation Instructions

If you are new to Python and not even sure how to set up your Python environment, please also refer to our beginner tutorials (work in progress).

Note that this is just ONE way to set up your environment and cloning the latest QSDsan-related packages (not the pip-installed version which are only released periodically), not THE way.

  1. Download and install Anaconda

    • You will see the Python version that comes with the Anaconda when you download it (Python 3.9 as of 9/21/2022).``QSDsan`` is mainly developed on Python 3.9 at the time that this tutorial was written.

  2. Make a new conda environment with the same version of Python as the base environment in the Anaconda you just installed, e.g., for Python 3.9, in your command line interface (CLI, Anaconda Prompt for Windows and terminal for Mac):

    conda create --name py39 python=3.9
    
    conda activate py39
    
    • The py39 is simply the name for the environment, you can change it to other ones that make more sense (e.g., qsdsan, dev), all of the following CLI codes should be executed on this environment

  3. Install Spyder, in your CLI

    pip install spyder
    
  4. Download GitHub Desktop if you are not comfortable with git in CLI, but it does not have all the capacities of CLI

  5. Clone repositories, you’ll want to clone the qsdsan branches of BioSTEAM/Thermosteam (dependencies of QSDsan that are being actively developed), and the main branches of QSDsan/EXPOsan. In your CLI (QSDsan as the example):

    git clone https://github.com/QSD-Group/QSDsan.git --depth=1 --no-single-branch
    
    • The depth flag allows you to clone only the most recent commits so the repo size will be smaller; the no-single-branch flag allows you to switch between the different branches

    • If you need to clone a branch that is not the default branch (e.g., the qsdsan branch of BioSTEAM, add @<BRANCH_NAME> after .git, i.e., git clone https://github.com/BioSTEAMDevelopmentGroup/biosteam.git@qsdsan --depth=1 --no-single-branch)

    • GitHub Desktop instructions

  6. Install graphviz (you may run into all sorts of issues, search engines are very helpful…)

    • Windows instructions

      • Read the instructions… or it might not work

      • You might need to add Graphviz/bin to Spyder’s PYTHONPATH manager

    • Mac instructions

      pip install graphviz
      
      conda install graphviz
      
    • If this still won’t work (i.e., you cannot get diagrams using QSDsan), check out this FAQ

  7. Install dependency packages

    pip install exposan
    pip uninstall biosteam thermosteam qsdsan exposan
    
  8. Add the path to ALL of the repositories you cloned in Spyder

  9. Open Spyder

    • In your CLI, just do spyder

    • Read all of the instructions upon opening Spyder

    • Add the path in Spyder’s PYTHONPATH manager