On Wed, 2009-10-14 at 09:44 +0200, Federico Di Gregorio wrote:
> Il giorno mer, 14/10/2009 alle 10.39 +0530, Arun Tomar ha scritto:
> > I"m on osol0906, with python2.6 on a virtualenv. I want to install
> > psycopg2 (postgres driver), but i'm not able to. 
> > 
> > I"ve tried both the methods, easy_install and python setup.py build
> > both
> > of them throws error. 
> > 
> > (venv)arun at opensolaris:/tmp/psycopg2-2.0.13$ python
> > Python 2.6.1 (r261:67515, Mar 10 2009, 14:11:34) [C] on sunos5
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> ^D
> > 
> > (venv)arun at opensolaris:/tmp$ cd psycopg2-2.0.13/
> > (venv)arun at opensolaris:/tmp/psycopg2-2.0.13$ ls
> > AUTHORS    debian  examples  lib      MANIFEST     PKG-INFO
> > psycopg2da
> > scripts    setup.py  ZPsycopgDA
> > ChangeLog  doc     INSTALL   LICENSE  MANIFEST.in  psycopg   README
> > setup.cfg  tests
> > 
> > (venv)arun at opensolaris:/tmp/psycopg2-2.0.13$ python setup.py build
> > running build
> > running build_py
> > creating build
> > creating build/lib.solaris-2.11-i86pc-2.6
> > creating build/lib.solaris-2.11-i86pc-2.6/psycopg2
> > copying lib/tz.py -> build/lib.solaris-2.11-i86pc-2.6/psycopg2
> > copying lib/extensions.py -> build/lib.solaris-2.11-i86pc-2.6/psycopg2
> > copying lib/pool.py -> build/lib.solaris-2.11-i86pc-2.6/psycopg2
> > copying lib/__init__.py -> build/lib.solaris-2.11-i86pc-2.6/psycopg2
> > copying lib/psycopg1.py -> build/lib.solaris-2.11-i86pc-2.6/psycopg2
> > copying lib/extras.py -> build/lib.solaris-2.11-i86pc-2.6/psycopg2
> > copying lib/errorcodes.py -> build/lib.solaris-2.11-i86pc-2.6/psycopg2
> > running build_ext
> > error: No such file or directory 
> 
> setup.py does not find pg_config. Install the development packages for
> PostgreSQL.
> 
> Hope this helps,
> federico
> 
Hi!

finally psycopg2 got installed, although it threw some warnings,
something related to static and non static declarations, but for now you
can ignore them.

here are the steps:

make sure these packages are intalled. 

arun at opensolaris:~# pkg list|grep postgr
SUNWpostgr-83-client                          8.3.7-0.111     installed
----
SUNWpostgr-83-devel                           8.3.7-0.111     installed
----
SUNWpostgr-83-libs                            8.3.7-0.111     installed
----
SUNWpostgr-83-server                          8.3.7-0.111     installed
----

#add postgres to the system path
arun at opensolaris:~# cat ~/.bashrc
#
# Define default prompt to <username>@<hostname>:<path><"($|#) ">
# and print '#' for user "root" and '$' for normal users.
#

export
PATH=/usr/gnu/bin:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin:/opt/csw/bin:/opt/csw/sbin:/opt/sfw/bin:/usr/postgres/8.3/bin/64
export
MANPATH=/usr/gnu/share/man:/usr/share/man:/usr/X11/share/man:/opt/csw/share/man

#export the postgres library
export LD_LIBRARY_PATH=/usr/postgres/8.3/lib

PS1='${logna...@$(/usr/bin/hostname):$(
    [[ "${LOGNAME}" == "root" ]] && printf "%s" "${PWD/${HOME}/~}# " ||
    printf "%s" "${PWD/${HOME}/~}\$ ")'


#added by arun

export TERM=xterm-color

alias l='ls -l'

arun at opensolaris:~# svcs -a|grep postgres
disabled       Oct_11
svc:/application/database/postgresql_83:default_32bit
online         13:47:49
svc:/application/database/postgresql_83:default_64bit

(venv)arun at opensolaris:~$ python
Python 2.6.1 (r261:67515, Mar 10 2009, 14:11:34) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2

regds,
Arun.

Reply via email to