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.
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.
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
Install Spyder, in your CLI
pip install spyder
Download GitHub Desktop if you are not comfortable with git in CLI, but it does not have all the capacities of CLI
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 ofQSDsan
/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; theno-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
- The
Install graphviz (you may run into all sorts of issues, search engines are very helpful…)
Install dependency packages
pip install exposan pip uninstall biosteam thermosteam qsdsan exposan
Add the path to ALL of the repositories you cloned in Spyder
Open Spyder
- In your CLI, just do
spyder
- Read all of the instructions upon opening Spyder
- Add the path in Spyder’s PYTHONPATH manager
- In your CLI, just do