Hola,

Ya logré, con la ayuda de Uds., instalar el software, psycopg2-2.0.8, para acceder a postgresql desde python. El problema consistía en que en el fichero setup.cfg hay que descomentar y configurar el siguiente path:

# "pg_config" is the preferred method to locate PostgreSQL headers and
# libraries needed to build psycopg2. If pg_config is not in the path or
# is installed under a different name uncomment the following option and
# set it to the pg_config full path.
pg_config=/usr/local/pgsql/bin/pg_config

Ahora el error es otro, cuando ejecuto python y luego trato de importar el módulo para este fin, obtengo el siguiente error:

Jerusalen:~ # python
Python 2.4.1 (#1, Sep 13 2005, 00:39:20)
[GCC 4.0.2 20050901 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from django.shortcuts import render_to_response
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/django/shortcuts/__init__.py", line 9, in ?
    from django.db.models.manager import Manager
File "/usr/lib/python2.4/site-packages/django/db/__init__.py", line 9, in ?
    if not settings.DATABASE_ENGINE:
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 28, in __getattr__
    self._import_settings()
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 57, in _import_settings raise ImportError("Settings cannot be imported, because environment variable %s is undefined." % ENVIRONMENT_VARIABLE) ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.

---------------------------------------
   Red Telematica de Salud - Cuba
          CNICM - Infomed
--
TIP 7: no olvides aumentar la configuración del "free space map"

Responder a