>I'm asking what do I place into the pg_config and library_dirs in order for >the installation to work on the client web server? Or what do I in general to >make it work?
I don't know what you mean by "place into". Make sure you read the INSTALL and README files carefully that came with your psycopg tarball. (PS I'd recommend using version 2 of psycopg just in case you aren't already). This is directly from setup.cfg in a recent version of pyscopg: # "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= pg_config is a command that comes with Postgres and provides configuration parameters relating to your installation of Postgres. You can check if it is installed by entering "pg_config" on the command line. If you get a listing of key-value pairs relating to the installation of Postgres, then it is installed and on your system path, therefore the psycopg build should be able to locate and use it. If you get "command not found", then it is either not installed or not on the system path. If thats the case (and it sounds like it is), then you have two options: 1) figure out how to get pg_config installed or if it is and is just not on the path, add the location of the command to your system path. 2) follow the optional instructions in setup.cfg: # If "pg_config" is not available, "include_dirs" can be used to locate # postgresql headers and libraries. Some extra checks on sys.platform will # still be done in setup.py. # The next line is the default as used on psycopg author Debian laptop: #include_dirs=/usr/include/postgresql:/usr/include/postgresql/server What this means is you need to make the Postgres headers and libs available so the psycopg build can find the appropriate headers and link to the Postgres client libs. Now I'm not sure what OS you're on, but most of the modern linux distros have some sort of package management utilities that will grab these packages, install, and configure them in a manner that is consistent with conventions on the particular OS of your choice. For example I use Debian/Ubuntu and the process of installing these would be (this is not verbatim, just illustrating) --install postgres # apt-get install postgresql-8.2 --install postgres headers and libs # apt-get install postgresql-8.2-dev --install psycopg2 # apt-get python-psycopg2 Again, I don't remember the exact package names. Hope this helps. If you're having trouble configuring Postgres in a client/server setup, I would search and direct your questions to postgres mailing lists and forums and look for tips relating specifically to your OS. -Brian On Apr 17, 9:38 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm just trying to install Psycopg2 on the client (webserver) which is > connected via ethernet to the Database server. But to do so I thought I had > to update the pg_config and library_dirs in the psychpg2 file: setup.cfg, > otherwise I get the following if I do nothing to it: > > running buildcd install/psycopg2-2.0.5.1 > running build_pyall/psycopg2-2.0.5.1# ls > running build_ext INSTALL MANIFEST psycopg setup.cfg ZPsycopgDA > Warning: /bin/sh: line 1: pg_config: command not foundtup.py > building 'psycopg2._psycopg' extension scripts tests > gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -fPIC -DPY_MAJOR_VERSION=2 -DPY_MINOR_VERSION=5 -DHAVE_PYBOOL=1 > -DHAVE_DECIMAL=1 -DHAVE_PYDATETIME=1 -DPSYCOPG_DEFAULT_PYDATETIME=1 > -DPSYCOPG_VERSION="2.0.5.1 (dec dt ext pq3)" -DPSYCOPG_EXTENSIONS=1 > -DPSYCOPG_DISPLAY_SIZE=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 > -DHAVE_PQPROTOCOL3=1 -I/usr/local/include/python2.5 -I. -c > psycopg/psycopgmodule.c -o build/temp.linux-i686-2.5/psycopg/psycopgmodule.o > In file included from psycopg/psycopgmodule.c:28: > ./psycopg/connection.h:26:22: error: libpq-fe.h: No such file or directory > In file included from psycopg/psycopgmodule.c:28: > ./psycopg/connection.h:55: error: expected specifier-qualifier-list before > 'PGconn' > In file included from psycopg/psycopgmodule.c:29: > ./psycopg/cursor.h:55: error: expected specifier-qualifier-list before > 'PGresult' > psycopg/psycopgmodule.c: In function '_psyco_connect_fill_exc': > psycopg/psycopgmodule.c:103: error: 'connectionObject' has no member named > 'exc_Error' > psycopg/psycopgmodule.c:105: error: 'connectionObject' has no member named > 'exc_Warning' > psycopg/psycopgmodule.c:107: error: 'connectionObject' has no member named > 'exc_InterfaceError' > psycopg/psycopgmodule.c:109: error: 'connectionObject' has no member named > 'exc_DatabaseError' > psycopg/psycopgmodule.c:111: error: 'connectionObject' has no member named > 'exc_InternalError' > psycopg/psycopgmodule.c:113: error: 'connectionObject' has no member named > 'exc_ProgrammingError' > psycopg/psycopgmodule.c:115: error: 'connectionObject' has no member named > 'exc_IntegrityError' > psycopg/psycopgmodule.c:117: error: 'connectionObject' has no member named > 'exc_DataError' > psycopg/psycopgmodule.c:119: error: 'connectionObject' has no member named > 'exc_NotSupportedError' > psycopg/psycopgmodule.c:121: error: 'connectionObject' has no member named > 'exc_OperationalError' > error: command 'gcc' failed with exit status 1 > > I'm asking what do I place into the pg_config and library_dirs in order for > the installation to work on the client web server? Or what do I in general to > make it work? > > I mentioned in my previous email, that > pg_config=/usr/local/pgsql/bin/pg_config and > library_dirs=/usr/local/pgsql/lib on the database, but how do I reference > this in the installation of Psychpg on the client webserver? > > ---- Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > > > On Wed, 2007-04-18 at 13:49 +1000, Mark Jarecki wrote: > > > To further illustrate my question. > > > > When installing Psychopg2, if the Database server was on the same > > > machine as the Web server, I would normally update the setup.cfg > > > prior to running "python setup.py build", with the following: > > > > pg_config=/usr/local/pgsql/bin/pg_config > > > library_dirs=/usr/local/pgsql/lib > > > > However, as I want to separate the Web server and the Database > > > server, and the above file and directory are on another machine (say > > > 192.168.344.222), what should I enter in these fields? > > > I don't really understand what you're trying to do with setup.cfg (what > > package is this setup file for?), but to answer your original question, > > the psycopg module lives on the database client side -- so on the web > > server in this case. It is loaded and used by the webserver code to act > > as a client to talk to a remote database server. Basically psycopg2 is > > the python equivalent of the psql program. > > > Regards, > > Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---