Clean install and this time I don't get the "not found" error for the psycopg2 module
But now I get this one
Script Error embedded script: dlopen(/Library/Python/2.6/site-packages/psycopg2/_psycopg.so, 2): Symbol not found: _PQbackendPID
Referenced from: /Library/Python/2.6/site-packages/psycopg2/_psycopg.so
Expected in: flat namespace
in /Library/Python/2.6/site-packages/psycopg2/_psycopg.so
Script Error Exception Traceback (most recent call shown last):
embedded script, line 1, at top level
File "/Library/Python/2.6/site-packages/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/Library/Python/2.6/site-packages/psycopg2/_psycopg.so, 2): Symbol not found: _PQbackendPID
Referenced from: /Library/Python/2.6/site-packages/psycopg2/_psycopg.so
Expected in: flat namespace
in /Library/Python/2.6/site-packages/psycopg2/_psycopg.so
This is the script I try to execute btw:
import psycopg2
try:
conn = psycopg2.connect(database="indigo_history", user="postgres", password="", host="127.0.0.1", port="5432")
cursor = conn.cursor()
cursor.execute("SELECT to_char(max(accumenergytotal) - min(accumenergytotal),'99999999D9') FROM device_history_363422168 WHERE ts > CURRENT_TIMESTAMP - INTERVAL '1440 minutes'")
rows = cursor.fetchall()
except:
indigo.server.log(u"Unable to open database.")
foo = str(rows[0][0])
indigo.variable.updateValue(898940884, foo)