Install Pyrseas in Windows 64bits

Pyrseas is a Database Version Control for PostgreSQL with a very interesting approach and with an easy way to script a database (database to a YAML file) and to apply changes to a database (YAML file to a database). It’s develped in Python by Joe Abbate (thank you Joe for it!)

Currently I’m using dbtoyaml to script the database in every release and I commit it together with application code, but in the future I plan to use it together with yamltodb for continuous integration.

Brief introduction

Joe describes it as follows:

Pyrseas provides a framework and utilities to upgrade and maintain a PostgreSQL database.


  • Outputs a YAML/JSON description of a PostgreSQL database’s tables and other objects (metadata), suitable for storing in a version control repository.
  • Generates SQL statements to modify a database so that it will match an input YAML/JSON specification.
  • (planned) Generates a flexible web application to update PostgreSQL  tables.


  • PostgreSQL 8.4 or higher
  • Python 2.6 or higher
  • (planned) Werkzeug
  • (planned) Jinja2


  • Pyrseas is free (libre) software and is distributed under the BSD license.

You can download it from GitHub and the most current documentation is available here.

Installing required packages

I suppose that in Linux its installation is quite straight forward, but in Windows Server 2008 R2 you need 64bits packages and not all required packages have their official 64bits version. So, I had to search for some alternative to install Pyrseas pre-requisites.

I installed these packages in the following order:

  • Python 2.7.3 Windows X86-64 Installer (Windows AMD64 / Intel 64 / X86-64 binary — does not include source). I suggest to add python in PATH environment variable.
  • From an unofficial website, where they advice you with “The files are unofficial(meaning: informal, unrecognized, personal, unsupported) and made available for testing and evaluation purposes.” You can download and install:
    • (it’s a replacement for setuptools).
  • (official website).

Installing Pyrseas

After downloading it from GitHub, unzip the file and into the directory execute:

python install


E:\Temp\pyrseas-0.5.0>python install
running install
running bdist_egg
running egg_info
Using e:\python27\lib\site-packages
Searching for psycopg2==2.4.5
Best match: psycopg2 2.4.5
Adding psycopg2 2.4.5 to easy-install.pth file
Using e:\python27\lib\site-packages
Searching for distribute==0.6.26
Best match: distribute 0.6.26
Adding distribute 0.6.26 to easy-install.pth file
Installing script to E:\Python27\Scripts
Installing easy_install.exe script to E:\Python27\Scripts
Installing script to E:\Python27\Scripts
Installing easy_install-2.7.exe script to E:\Python27\Scripts
Using e:\python27\lib\site-packages
Finished processing dependencies for Pyrseas==0.5.0

Using it

Once installed, you can execute it. For example:

cd C:\Python27\Lib\site-packages\Pyrseas-0.5.0-py2.7.egg\pyrseas

python –host=”″ -U myuser mydatabase > E:\temp\mydatabase.yaml

If everything goes fine, you should have the file E:\temp\dbagn.yaml that describes your database. Now you can test easily yamltodb by deleting or adding a column in a table in YAML file and run it:

python –host=”″ –user=postgres –output=”deltascript.sql” mydatabase mydatabase.yaml

Then, you’ll apply the changes made in the YAML file to the database!


It’s interesting, isn’t it? I like to script out the database schema and nowadays with ORM products it’s even more important: you never now what’s happening behind the scenes…

About these ads

2 Responses to Install Pyrseas in Windows 64bits

  1. jma says:

    BTW, the most current documentation is available at .

    If it’s OK with you, I’ll incorporate your findings about the Windows 64-bit dependencies into the Pyrseas doc (similar to the note that is already there for FreeBSD [ ]).

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: