Skip site navigation (1) Skip section navigation (2)

Re: pl/pyton: exceptions.ImportError: No module named

From: Eugene Prokopiev <prokopiev(at)stc(dot)donpac(dot)ru>
To: Michael Fuhr <mike(at)fuhr(dot)org>, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: pl/pyton: exceptions.ImportError: No module named
Date: 2005-11-28 05:49:32
Message-ID: 438A9A6C.9000806@stc.donpac.ru (view raw or flat)
Thread:
Lists: pgsql-interfaces
I use PostgreSQL 8.1.0 and Python 2.3.3

$ psql -U postgres test

test=# CREATE FUNCTION pyversion() RETURNS text AS $$
test$# import sys
test$# return sys.version + '\n' + '\n'.join(sys.path)
test$# $$ LANGUAGE plpythonu;
CREATE FUNCTION
test=# select pyversion();
 
                             pyversion 

------------------------------------------------------
  2.3.3 (#1, Jul  5 2004, 13:54:49)
[GCC 3.3.3 20040412 (ALT Linux, build 3.3.3-alt5)]
/usr/lib/python23.zip
/usr/lib/python2.3/
/usr/lib/python2.3/plat-linux2
/usr/lib/python2.3/lib-tk
/usr/lib/lib-dynload
(1 record)

test=# \q

$ python -c 'import sys; print sys.version, sys.path'
2.3.3 (#1, Jul  5 2004, 13:54:49)
[GCC 3.3.3 20040412 (ALT Linux, build 3.3.3-alt5)] ['', 
'/usr/lib/python23.zip', '/usr/lib/python2.3', 
'/usr/lib/python2.3/plat-linux2', '/usr/lib/python2.3/lib-tk', 
'/usr/lib/python2.3/lib-dynload', '/usr/lib/python2.3/site-packages']

$ ldd /usr/bin/python
         libpython2.3.so.1.0 => /usr/lib/libpython2.3.so.1.0 (0x00116000)
         libpthread.so.0 => /lib/libpthread.so.0 (0x001fb000)
         libdl.so.2 => /lib/libdl.so.2 (0x0024f000)
         libutil.so.1 => /lib/libutil.so.1 (0x00253000)
         libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x00257000)
         libm.so.6 => /lib/libm.so.6 (0x00310000)
         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00333000)
         libc.so.6 => /lib/libc.so.6 (0x0033c000)
         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

$ ldd /usr/lib/pgsql/plpython.so
         libpython2.3.so.1.0 => /usr/lib/libpython2.3.so.1.0 (0x0011f000)
         libpthread.so.0 => /lib/libpthread.so.0 (0x00204000)
         libdl.so.2 => /lib/libdl.so.2 (0x00258000)
         libutil.so.1 => /lib/libutil.so.1 (0x0025c000)
         libm.so.6 => /lib/libm.so.6 (0x00260000)
         libc.so.6 => /lib/libc.so.6 (0x00283000)
         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

Python versions are the same

-- 
Thanks,
Eugene Prokopiev

In response to

pgsql-interfaces by date

Next:From: Irina SourikovaDate: 2005-11-28 21:39:57
Subject: BLOB handling compatibility with PostgreSQL > 7.4
Previous:From: Tom LaneDate: 2005-11-27 22:51:20
Subject: Re: PG_COMMAND_OK oid information required

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group