
Hi Peter, Thanks for your reply. Galaxy is running from the same user account as the account I used to run the script from the command line so I assumed it would also get the LD_LIBRARY_PATH from the .bashrc It seems that when galaxy is run it doesn't pick up this environment variable from the system. I have just added the export command to my run.sh file and my script now works. So problem solved. Thanks for your helpful and quick response. Ian
Assuming Galaxy runs under a different user account, does that account also have LD_LIBRARY_PATH setup in its .bashrc or added to the Galaxy run.sh script?
Peter
On Thu, Dec 16, 2010 at 9:25 PM, <henry@mpi-cbg.de> wrote:
I have a local installation of galaxy running and I'm trying to run a custom python script "sequence_logo.py" from galaxy. We have many other custom scripts installed and running perfectly well, but this is the first to import rpy2 modules.
If galaxy runs the code it gives the following error:
Traceback (most recent call last): File "/home/galaxy/galaxy_dist/tools/MPItools/sequence_logo.py", line 3, in import rpy2.robjects as robjects File "/usr/local/lib/python2.6/dist-packages/rpy2-2.1.9_20101216-py2.6-linux-x86_64.egg/rpy2/robjects/__init__.py", line 14, in import rpy2.rinterface as rinterface File "/usr/local/lib/python2.6/dist-packages/rpy2-2.1.9_20101216-py2.6-linux-x86_64.egg/rpy2/rinterface/__init__.py", line 79, in from rpy2.rinterface.rinterface import * ImportError: libR.so: cannot open shared object file: No such file or directory
However if I run the script from the command line on our galaxy machine the import statements work and the code runs.
Originally when I installed rpy2 via easy_install the script ran neither from the command line nor galaxy. I read from Rpy help that this was because RPy could not find libR.so and I followed the following fix:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH\:R_HOME/bin
As a result I can now run the script from the command line but still not from galaxy. The export is now in my .bashrc too.
Does anyone have any ideas why the rpy2 import statements work at the command line and python console, but not from within Galaxy. Any help would be greatly apprecriated.
The import line that fails is as follows: import rpy2.robjects as robjects
Thanks,
Ian Henry