Skip to content

WIN SETUP

View or edit on GitHub

This page is synchronized from WIN_SETUP.md. Last modified on 2025-12-09 00:30 CET by Trase Admin. Please view or edit the original file there; changes should be reflected here after a midnight build (CET time), or manually triggering it with a GitHub action (link).

How to Setup PCS in Windows (Jan2018)

Suggested structure is to install non-system programs to a folder C:\Programs

  1. Create a dev directory in your home directory (C:\Users{user}\dev) you can clone TRASE in here.

  2. Setup python3, pip and virtualenv

    • Pip is installed by default with Python3
    • Make sure that python is on your path in System->Advanced System Settings->Environment Variables:PATH
    • Create a folder for your virtual environments in your dev folder
    • Add the python/Scripts to the PATH as well
  3. Install cmder as a unix friendly shell if you like and at it to your PATH.

    • Cygwin how to will come later, more robust unix environment under windows
  4. Install MingW64 for git (or setup otherwise in cmder or cygwin)

  5. Install PostgreSQL for Windows and PgAdmin

    • The EnterpriseDB install is recommended
    • PGAdmin3 is faster than PGAdmin4 currently, however it has stopped being supported)
    • Create your user account (will need to have permissions to create and delete databases, superuser should be fine for local development)
    • Edit the file ~\AppData\Roaming\postgresql\pgpass.conf by adding the line: localhost:5432:database_name:username:password (NOTE: Having '*' for database_name will allow all.) This then means you will be able to access the db within pcs without password prompt.
    • Install PostGIS: Boston GIS PostGIS tutorial

    • Any updates to pg_hba.conf requires a reloading of conf: SELECT pg_reload_conf()

  6. Install 7-zip archiving application (this will be used for database dump extraction in the pcs setup).

  7. Create a virtualenv: virtualenv {traseenv_name}

    • Start/stop your env by running: \traseenv_name\Scripts\activate.bat \traseenv_name\Scripts\deactivate.bat

Clone Trase

Clone the 'normalize' branch of the TRASE repo to your dev folder. - If necessary create the PYTHONPATH environment variable - Add ~\dev\TRASE\lib to your PYTHONPATH - Add C:\Program Files\7-zip to you PYTHONPATH

Create and move to a branch: git branch -b {your_branch_name} {normalize} git checkout {your_branch_name}

Install Requirements Install the project dependencies by starting the environment and running the shell command (from the TRASE folder): pip install -r requirements.txt

Now ready to work with your favourite text editor.

Configurations

See main README.md

In a python shell:

from trase.tools.pcs import * (try choosing both Remote and Local in two runs) get_supply_chain()

On startup, the Remote should have data and the local should have no data. At this stage you should find your database tables and schemas created in postgres.

Add to .gitignore: .idea/ db/core_dump.sql db/~AppDataRoamingpostgresqlpgpass.conf

Commit and push a first git change (using git status for sanity checks):

git status
git add .gitignore
git commit -m "Your msg here"
git status
git push origin {branch_name}