[scribus-dev] Scribus 1.5 Windows Python PostgreSQL

John L. Poole jlpoole56 at gmail.com
Sat May 30 08:15:33 UTC 2015


I have Scribus 1.5 built 19 May 2015, Build ID: 
C-*-T-*-C1.12.18-Windows-64bit

I want to be able to call a Python script which connects to a PostgreSQL 
database.

I tried this simple test script:

      #
      # tests ability to connect to postgresql from within Scribus Python
      #
      #
      import sys

      # environment checking
      try:
          import scribus
      except ImportError:
          print "This script only runs from within Scribus."
          sys.exit(1)

      import psycopg2 as dbapi2
      db = dbapi2.connect (database="scribudb", user="xxx", password="xxx")
      cur = db.cursor()

and, of course, got the error message:

       ImportError: No module named psycopg2

I finding on the Scribus  wiki at 
http://wiki.scribus.net/canvas/Scripter/Databases


    Python Database Module

      There are various modules 
<http://www.python.org/topics/database/modules.html> for database 
access. Remember that the module
*must be [emphasis]* installed in/with the Python version which is 
used/compiled in Scribus!

Is there a way to patch a module into the Python tree for Scribus?  
Alternatively,
can I direct Scribus to use my Python 2.7 installed on my Windows box 
wherein
I can install whatever modules?




More information about the scribus-dev mailing list