SWAT+ Installation & Help
1.2
1.2
  • About SWAT+
  • Installation
  • Getting Started
  • Get Help
    • Troubleshooting
  • Release Notes
  • Source Code
  • Download Docs
  • User Docs
    • SWAT+ Editor Documentation
      • Project Setup
      • Edit SWAT+ Inputs
        • Climate
        • Simulation
        • Basin
        • Connections
          • Channels
          • HRUs
          • Routing Units
          • Aquifers
          • Reservoirs
          • Recall (Point Source/Inlet)
          • Export Coefficients
          • Delivery Ratio
        • Regions
        • Land Use Management
        • Decision Tables
        • Change/Calibration
        • Initialization Data
        • Hydrology
        • Soils
        • Databases
        • Structural
      • Write Input Files
      • Run SWAT+
      • Analyze Output
    • QSWAT+ Manual
    • SWAT+ IO Documentation
    • How to Use SQLite
  • Developer Docs
    • SWAT+ Editor Design
Powered by GitBook
On this page
  • Repository Links
  • Run and Compile SWAT+ Editor
  • Install Development Tools
  • Run the Source Code
  • Build the Source Code
Export as PDF

Source Code

Last updated 5 years ago

Repository Links

Run and Compile SWAT+ Editor

Install Development Tools

  • You may use any IDE of your choice, however is used by the developer.

  • Install

  • Install required Python packages. From command prompt, go to source code /api directory and run:

pip install -r requirements.txt
  • Install

  • Install required Node.js packages. From command prompt, go to the root directory of the source code and run:

npm install

Run the Source Code

From a command prompt in the root directory (terminal inside Visual Studio Code)

npm run dev

Open a second command prompt and run

npm run electron

Build the Source Code

pyinstaller_builds

Note: PyInstaller will create 32 or 64-bit executables depending on the version of Python you have installed.

Next, build the Vue.js code. Open a command prompt and run:

npm run build

Create an installer:

npm run dist

Or, build a portable executable:

npm run dist-port

Or, pack the files into a directory:

npm run pack

First, use (included in the Python packages during install) to freeze the Python into executable files. This should be done from the /api directory in the source code. In Windows, run the supplied .bat file from a command prompt:

Finally, package the code for distribution using . Configuration is set in the package.json file. Results of the build will be placed in the /release/dist directory.

SWAT+ source code repository
SWAT+ Editor source code repository
QSWAT+ source code repository
Visual Studio Code
Python 3.7
Node.js
PyInstaller
Electron Builder