Question: No module named Galaxy when running an old tool (PeakRanger)
0
gravatar for david.roquis
9 months ago by
david.roquis30
david.roquis30 wrote:

Dear Galaxy Community

I have recently installed PeakRanger from the Toolshed. I struggled a bit because the wrapper is old, the link to download the dependency was not working (in tool_dependencies.xml), and there were a lot of identation problems with the python wrapper called to execute the tool. I fixed everything, but...

Now I am facing a new problem; when I try to run the tool

    Traceback (most recent call last):
  File "/mnt/extStorage/shed_tools/toolshed.g2.bx.psu.edu/repos/modencode-dcc/peakranger/d6b1bb81fa6c/peakranger/ranger_wrapper.py", line 6, in 
    from galaxy import eggs
ImportError: No module named galaxy
WARNING:galaxy.model:Datatype class not found for extension 'wig, zip'
WARNING:galaxy.model:Datatype class not found for extension 'wig, zip'
WARNING:galaxy.model:Datatype class not found for extension 'wig, zip'
WARNING:galaxy.model:Datatype class not found for extension 'wig, zip'
WARNING:galaxy.model:Datatype class not found for extension 'wig, zip'

I have read on forums that is is probably related to PYTHONPATH, but I don't exactly know how to fix it. I am using the most recent distribution of Galaxy with a virtual environment. By default, I dont have a $PYTHONPATH environment variable set up on my system (doing an echo prints nothing).

Thanks in advance for your help!

Sincerely

David

peakranger galaxy python • 378 views
ADD COMMENTlink modified 9 months ago • written 9 months ago by david.roquis30
1
gravatar for Hotz, Hans-Rudolf
9 months ago by
Switzerland
Hotz, Hans-Rudolf1.8k wrote:

Hi David

Have you tried setting "preserve_python_environment = legacy_only" in galaxy.ini ? and list your tool in ~/lib/galaxy/tools/__init__.py : "GALAXY_LIB_TOOLS_UNVERSIONED = [..." (# Tools that require Galaxy's Python environment to be preserved.)

Regards, Hans-Rudolf

ADD COMMENTlink written 9 months ago by Hotz, Hans-Rudolf1.8k
1
gravatar for david.roquis
9 months ago by
david.roquis30
david.roquis30 wrote:

Dear Hans-Rudolf

Thank you for your message. I was able to solve the issue in a very unorthodox way. I will describe it here in case some people want to use this tool and face the same problem as I have.

  1. First of all, the link to download the tool in "tool_dependencies.xml" is obsolete. As an admin, I removed this faulty dependency from the admin panel, changed the link in tool_dependencies.xml to a valid one, and re-installed the missing dependency (actually, the peak ranger package) from the admin panel.

  2. The xml wrapper (ranger_wrapper.xml) was calling a python wrapper ranger_wrapper.py) which was causing two issues: a) importError no module named simplejson, b) importError no module named galaxy. I could solve both issues by a) installing simplejson in the galaxy virtualenv (I did so by adding "simplejson==3.13.2" in galaxy/requirements.txt and restarting galaxy) and b) adding the following line "sys.path.append("/mnt/extStorage/galaxy-app/lib")" just below "import sys, subprocess, tempfile, shutil, glob, os, os.path, gzip" in the python wrapper ranger_wrapper.py).

I am quite sure that what I did is kinda messy, but as it solved my issues, I thought it would be a good idea to share it.

Thanks again!

David

ADD COMMENTlink written 9 months ago by david.roquis30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 171 users visited in the last hour