Last revised: 10/5/2020
- Follow all the installations in installations doc, these are just the relevant ones for Python.
- Install PyCharm - Professional version: https://www.jetbrains.com/pycharm/. Get license from https://www.jetbrains.com/community/education/\#students and use it to activate.
- Install Python 64-bit (Python 3.8 is needed for Xanthos and Tethys, Python 2.7 is needed for Demeter).
- Save to Users\yourusername\AppData\Local\Programs\Python. Here we will have 2 folders "Python38 and Python27"
- Note: AppData is a hidden folder so you may need to type it out (rather than clicking in the window)
- Make sure the python.exe is saved
- Install Git LFS a. In Git Bash, type
git lfs install
to initialize Git LFS.
- Clone Xanthos, Tethys and Demeter. Recommend to clone these into a folder (e.g. called "INFEWS"" for the rest of this document) hard drive with a lot of space.
- Open this folder ("INFEWS"") in PyCharm as a project.
- Go to File > Settings > Project: INFEWS > Python Interpreter.
- Click the Settings icon > Add.
- In Location: enter D:\INFEWS\venv38 or \venv27, depending on if you are installing Python 3.8 or Python 2.7 respectively. We want to have 2 separate environments for these and be able to switch between them easily.
- In Base interpreter: navigate to the respective python.exe in the Python38 or Python27 folder.
- Click "OK".
- Under packages, make sure "pip"" and "setuptools"" are installed.
- We also want to add the xanthos, tethys, and demeter folder path to Interpreter Paths because part of corresponding packages are installed within those folders. Go to File > Settings > Project: INFEWS.
- Click the Settings icon > Show All.
- Click the version of Python we are adding to. For tethys and xanthos, it is Python 3.8 and for demeter it is Python 2.7.
- Click the lowest button on the right side of the window (Show paths for the selected interpreter).
- Click the + icon.
- Navigate to the tethys, xanthos or demeter folder within the INFEWS folder and Click "OK".
- Go to Terminal and navigate to one of the cloned folders (tethys, xanthos, etc).
- Run
python setup.py install
. - It should add Build and other folders to your cloned folder.
Notes for trouble shooting
- For setting up Demeter, may run into issues because not all the packages are installed.
- If there is an error within a joblib subfolder ("Missing package: setuptools not found. Demeter requires this to install. Please install setuptools and retry."). It's actually the case that other packages are not installed, even though setuptools is there. This is due to using Python 2.7 which has errors installing and updating packages. Need to manually install packages.
-
Install the following packages.
pip install joblib
-
Using the --use-feature=2020-resolver, install remaining packages needed (e.g. configobj, matplotlib, pyshp, scipy).
pip install matplotlib --use-feature=2020-resolver
- For Xanthos, we need to change the file paths in the "pm_abcd_mrtm.ini" file.
- Add the RootDir (give the full path of your xanthos/example folder, e.g. D:/INFEWS/xanthos/emaple).
- Change other file paths accordingly to point to the correct path for xanthos/example (or whatever script you are running).
- Similarly for Demeter, we need to update file paths in the "config.ini" file.
Try running the example.py script!