Problem importing locally installed python modules for spyce script
Hardeep Nahal <[email protected]> Fri, 9 Mar 2007 22:41:27 +0000 (UTC)
| Newsgroups | gmane.comp.python.spyce.general |
|---|---|
| Message-ID | <[email protected]> |
I'm a newbie to spyce and have a question that I hope someone can help me with.
I want to modify a spyce script and its associated modules which we are running
on our server. Usually I make a local copy of the script (ie. a cgi script) so I
can make modifications locally without affecting the main program. So for
example, the main program is stored in '/var/www/html/some_program', and I've
made a copy in my directory '/home/me/public_html/cgi-bin/some_program'. The
spyce program I'm working on depends on several python modules which we created
and are stored in the python directory on our server (ie.
'/usr/local/lib/python2.3/site-packages/some_program_modules'). I've
copied these module files to a local copy of python as well
('/home/me/lib/python2.3/site-packages/some_program_modules') because I want to
make some modifications to them. However, I've noticed that when I run the spyce
script, the local embedded python scripts (*.spy) are executed, but the program
imports the python module files that are stored in the
'/usr/local/lib/python2.3/site-packages/some_program_modules'
directory instead of the ones stored in my local directory
('/home/me/lib/python2.3/site-packages/some_program_modules'). I've checked the
PYTHONPATH variable and it's set to my local python directory. I've also noticed
that the spyceconfig.py file specifies a SPYCE_CLASS variable that tells it
where to find modules, so I appended my own directory to SPYCE_CLASS. However, I
still can't get the program to import only the locally installed modules. Is
there a way to make it ignore the modules stored in
'/usr/local/lib/python2.3/site-packages/some_program_modules', so it
will import from my
'/home/me/lib/python2.3/site-packages/some_program_modules' directory?
Or am I missing some variable that I should set in spyce to make it recognize
which python directory I want it to load modules from? I'm running Debian with
Apache 2.0.54 configured for mod_python 3.1.3, spyce 2.0.1 and Python 2.3. I
don't know what other information to provide, but if anyone has any suggestions
I'll gladly post the appropriate information if it helps. Thanks in advance.
best,
Hardeep
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV