Unable to import package over NFS in solaris

Ashok ashok86 at gmail.com
Wed Sep 23 12:15:50 EDT 2009


Hi,

I have sqlalchemy package installed on the server. However I want to
run a script on the client that uses the sqlalchemy package. Hence I
shared the directory containing the sqlalchemy unsing NFS. Then I
added the NFS pathname to the sqlalchemy packege in the client
program. Now when I import sqlalchemy in the client program it throws
the following error.

Traceback (most recent call last):
  File "/net/sqlhost/ashok/send.py", line 9, in ?
    from sqlalchemy import *
ImportError: No module named sqlalchemy


I have added the NFS path to the PYTHONPATH as folllows in my program.

#!/usr/bin/python

import os,commands,sys

os.environ['PYTHONPATH']='/net/sqlhost/usr/lib/python2.4/site-packages/
SQLAlchemy-0.5.6-py2.4.egg/sqlalchemy'
sys.path.append('/net/sqlhost/usr/lib/python2.4/site-packages/
SQLAlchemy-0.5.6-py2.4.egg/sqlalchemy')
from sqlalchemy import *

Contents of the directory shared under NFS in Solaris.

bash-3.00# ls /usr/lib/python2.4/site-packages/SQLAlchemy-0.5.6-
py2.4.egg/sqlalchemy/
__init__.py      engine           ext              log.py
pool.py          queue.pyc        sql              topological.pyc
util.py
__init__.pyc     exc.py           interfaces.py    log.pyc
pool.pyc         schema.py        test             types.py
util.pyc
databases        exc.pyc          interfaces.pyc   orm
queue.py         schema.pyc       topological.py   types.pyc

Please let me know what went wrong?

thx,
~Ashok.



More information about the Python-list mailing list