Question: Cannot get Galaxy to run on workstation
gravatar for CMonger
3.7 years ago by
CMonger0 wrote:

Hi all,

I'm having some trouble setting up a Galaxy instance on our workstation (which I ssh into). 

I have created a user specifically for Galaxy as described in the installation documents but am having trouble getting it to work. When using to start up the server I get this error (pastebin as wall of text)

However when I run as root with sudo the server starts up (but localhost:8080 isnt displaying the galaxy page, as any user).

Any ideas what could be going wrong? Galaxy doesn't start as root without using sudo, and both expat and elementtree are installed in both python 2.6 and 2.7, with correct permissions.

Thanks in advance.



Solution - Turns out this was a bug specific to python 2.7.3 which my debian distro shipped with. Using 2.7.10 in a virtual environment created with pythonbrew solved this problem.

galaxy • 1.2k views
ADD COMMENTlink modified 3.4 years ago • written 3.7 years ago by CMonger0

Try to run Galaxy in its own virtualenv.

ADD REPLYlink written 3.7 years ago by Martin Čech ♦♦ 4.9k

This was done in a virtualenv created as described here

ADD REPLYlink written 3.7 years ago by CMonger0
gravatar for Jennifer Hillman Jackson
3.7 years ago by
United States
Jennifer Hillman Jackson25k wrote:


This is an warning about the python version in use. Double check that you are running Python 2.6 or 2.7 and that this is the version the Galaxy user's PYTHONPATH points to.

Thanks, Jen, Galaxy team

ADD COMMENTlink written 3.7 years ago by Jennifer Hillman Jackson25k

Hi Jen, thanks for the quick response.

I deleted Python2.6 to avoid confusion between the 2 versions and changed the path as follows:

galaxy@bioinfo-wstation-01:~/galaxy$ export PYTHONPATH="/usr/bin/python2.7/:/usr/lib/python2.7/:/usr/lib/python2.7/xml/parsers/"
galaxy@bioinfo-wstation-01:~/galaxy$ echo $PYTHONPATH

and got the same error:

Traceback (most recent call last):
  File "/mnt/work/galaxy/galaxy/lib/galaxy/webapps/galaxy/", line 53, in app_factory
    app = global_conf=global_conf, **kwargs )
  File "/mnt/work/galaxy/galaxy/lib/galaxy/", line 55, in __init__
    self._configure_datatypes_registry( self.installed_repository_manager )
  File "/mnt/work/galaxy/galaxy/lib/galaxy/", line 782, in _configure_datatypes_registry
    self.datatypes_registry.load_datatypes( self.config.root, datatypes_config, override=True )
  File "/mnt/work/galaxy/galaxy/lib/galaxy/datatypes/", line 102, in load_datatypes
    tree = galaxy.util.parse_xml( config )
  File "/mnt/work/galaxy/galaxy/lib/galaxy/util/", line 177, in parse_xml
    root = tree.parse( fname, parser=ElementTree.XMLParser( target=DoctypeSafeCallbackTarget() ) )
  File "/usr/lib/python2.7/xml/etree/", line 1466, in __init__
    "No module named expat; use SimpleXMLTreeBuilder instead"
ImportError: No module named expat; use SimpleXMLTreeBuilder instead


Any other ideas/diagnostics?



ADD REPLYlink written 3.7 years ago by CMonger0

I've been having this problem with my Galaxy setup on Ubuntu14.04 LTS. However, I've narrowed it down to the installation of Matlab's Compiler Runtime. Matlab packages a bunch of libraries along with their runtime and these clash with the natural running of python, as well as with Ubuntu Unity. 

The problem occurs when you follow Matlab's instructions and add references to those libraries to the LD_LIBRARY_PATH variable (e.g. via your ~/.profile configuation). The moment you do this, python can't find the expat module, and you can't actually login to Ubuntu! Joy. 

The simple solution for me has been to remove those LD_LIBRARY_PATH references to Matlab's broken libraries and then ALSO to remove ~/.config which allowed the changes to actually kick in. 

I was led to this pseudo-understanding by this question and answer here:

Examples of problem libraries (solving the Ubuntu login but not the python situation) are those starting with libstdc* and libgcc*, but it must be different ones that are breaking python's module lookup because I'm still having to resort to not setting LD_LIBRARY_PATH to get that to work (my Ubuntu Unity login works regardless after the changes I've made).

So, you may not have installed Matlab's software but perhaps you've installed something else that does a similar thing.   

ADD REPLYlink written 3.3 years ago by bobbledavidson0

Is there any additional information I could provide to try and figure out the root of the problem? 

ADD REPLYlink written 3.7 years ago by CMonger0

I will point here some of our sysadmin-knowledgeable members. A long shot: I suspect that your Python installation is not working properly according to the links below.

I would check your python environment variables for root and the galaxy user. Also trying to use different python might be a test.

ADD REPLYlink modified 3.7 years ago • written 3.7 years ago by Martin Čech ♦♦ 4.9k

Hi Martin, thanks again for more advice.

As suggested in the first link, I checked my python path within the galaxy environment and it contained the path to the python modules (I specifically edited this to include a direct path to both expat and element tree in the /pathtopython/xml/etree/ and /pathtopython/xml/parser/ directories). However unfortunately this did not fix the problem and I receive the same error.

The second link suggests to change elementtrees definition as follows:

from xml.etree import ElementTree # part of python distribution
from elementtree import SimpleXMLTreeBuilder # part of your codebase
ElementTree.XMLTreeBuilder = SimpleXMLTreeBuilder.TreeBuilder

How would I go about doing this/what file do I need to add this definition to? (a google search turned up nothing that I understood)



ADD REPLYlink modified 3.7 years ago • written 3.7 years ago by CMonger0
Please log in to add an answer.


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