- Verify your PostgreSQL server installation has PL/Python support. In Windows, this should be already included, but this is not the default if you are using, for example, Ubuntu 16.04 LTS, so you will most likely need to install it:
$ sudo apt-get install postgresql-plpython-9.1
- Install PL/Python on the database (you could consider installing it in your template1 database; in this way, every newly created database will have PL/Python support by default):
You could alternatively add PL/Python support to your database, using the createlang shell command (this is the only way if you are using PostgreSQL version 9.1 or lower):
$ createlang plpythonu postgis_cookbook
$ psql -U me postgis_cookbook
postgis_cookbook=# CREATE EXTENSION ...