Using PL/Pythonu with virtualenv

I am writing function in postgres in python using the PL/Pythonu extension in postgres. I would like postgres to use my virutal environment (I am using virtualenv) instead of the global install. How do I go about doing this?


As it turns out, one must add the path to where the libraries are found to the PYTHONPATH environment variable in postgres. Don't forget to quote your value eg:

PYTHONPATH='path to libraries'

Answered over at

tl;dr - exec inside plpython function will set python interpretor for the life of the postgresql session.

Need Your Help

SQL Server failing recursive call between functions at production server

sql sql-server recursion user-defined-functions inline-table-function

I have one scalar-valued function, func-A and inline table-valued function, func-B. func-A calls func-B and func-B again calls func-A recursively. but the recursion level will never be too deep. It...

NVelocity ASP.NET Examples nvelocity

I'm looking to use NVelocity in my ASP.NET MVC application, not as a view engine, just for rendering some email templates.