[scribus-dev] Scribus 1.5 Windows Python PostgreSQL

John L. Poole jlpoole56 at gmail.com
Sat May 30 08:44:36 UTC 2015


I can answer my question.  Here's what I did:

1) renamed C:\Program Files\Scribus 1.5.0\python to C:\Program 
Files\Scribus 1.5.0\pythonHOLD
2) renamed C:\Program Files\Scribus 1.5.0\python27.dll to C:\Program 
Files\Scribus 1.5.0\HOLDpython27.dll

3) Downloaded from http://www.stickpeople.com/projects/python/win-psycopg/
  and ran (installed) psycopg2-2.6.0.win-amd64-py2.7-pg9.4.1-release.exe 
selecting my 2.7 environment.

I'm able to get past the error of " ImportError: No module named psycopg2".
I seem to be having problems authenticating to PostgreSQL failing the
password authentication, but I'm assuming I'll overcome that.

I wanted to post the above HowTO asap so nobody spends time answering it.

On 5/30/2015 1:15 AM, John L. Poole wrote:
> 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?
>

-- 
Email Rider

John Laurence Poole
P.O. Box 6566
Napa CA 94581-6566
707-812-1323 office

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus-dev/attachments/20150530/3ae3dec2/attachment.html>


More information about the scribus-dev mailing list