Hi,

installing tool dependency package_pybamtools_0_0_2 as well as package_pybamparser_0_0_1 cause below mansion errors.

Following the tool_dependencies.xml file:

 <action type="shell_command">hg clone -r ba0341816b15fff5e0a554658d6579a60e1b12b1 https://bitbucket.org/dan/pybamtools pyBamTools</action>
 <action type="make_directory">$INSTALL_DIR/lib/python</action>
 <action type="shell_command">export PYTHONPATH=$PYTHONPATH:$INSTALL_DIR/lib/python && python setup.py install --home $INSTALL_DIR</action> 

I can download this package and manually compile it without errors under Galaxy environments.
Question is what are sources of these errors and how to solve them using standard Galaxy installation procedure?

After googling this errors there were mentions that it can be due to deprecated package `distribute' in new version of python and it is better to use `setuptools'. 
It is also described in pybamtools sources and after small modification to use `setuptools' in setup.py script it is also manually compiled without problems.

Thanx,
Nikolaos


Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.38.tar.gz
Extracting in /tmp/tmpDIcsTL
Now working in /tmp/tmpDIcsTL/distribute-0.6.38
Building a Distribute egg in /home/galaxy/galaxy/database/tmp/tmp-toolshed-mtdFbEf6k/pyBamTools
Traceback (most recent call last):
  File "setup.py", line 248, in <module>
    scripts = scripts,
  File "/home/galaxy/python27/python/2.7.9/lib/python2.7/distutils/core.py", line 111, in setup
    _setup_distribution = dist = klass(attrs)
  File "/tmp/tmpDIcsTL/distribute-0.6.38/setuptools/dist.py", line 225, in __init__
    _Distribution.__init__(self,attrs)
  File "/home/galaxy/python27/python/2.7.9/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/tmp/tmpDIcsTL/distribute-0.6.38/setuptools/dist.py", line 257, in finalize_options
    ep.require(installer=self.fetch_build_egg)
  File "/tmp/tmpDIcsTL/distribute-0.6.38/pkg_resources.py", line 2027, in require
    working_set.resolve(self.dist.requires(self.extras),env,installer))
  File "/tmp/tmpDIcsTL/distribute-0.6.38/pkg_resources.py", line 2237, in requires
    dm = self._dep_map
  File "/tmp/tmpDIcsTL/distribute-0.6.38/pkg_resources.py", line 2466, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/tmp/tmpDIcsTL/distribute-0.6.38/pkg_resources.py", line 2499, in _compute_dependencies
    common = frozenset(reqs_for_extra(None))
  File "/tmp/tmpDIcsTL/distribute-0.6.38/pkg_resources.py", line 2496, in reqs_for_extra
    if req.marker_fn(override={'extra':extra}):
  File "/tmp/tmpDIcsTL/distribute-0.6.38/_markerlib/markers.py", line 109, in marker_fn
    return eval(compiled_marker, environment)
  File "<environment marker>", line 1, in <module>
NameError: name 'sys_platform' is not defined
/home/galaxy/galaxy/database/tmp/tmp-toolshed-mtdFbEf6k/pyBamTools/distribute-0.6.38-py2.7.egg
Traceback (most recent call last):
  File "setup.py", line 9, in <module>
    use_setuptools()
  File "/home/galaxy/galaxy/database/tmp/tmp-toolshed-mtdFbEf6k/pyBamTools/distribute_setup.py", line 152, in use_setuptools
    return _do_download(version, download_base, to_dir, download_delay)
  File "/home/galaxy/galaxy/database/tmp/tmp-toolshed-mtdFbEf6k/pyBamTools/distribute_setup.py", line 132, in _do_download
    _build_egg(egg, tarball, to_dir)
  File "/home/galaxy/galaxy/database/tmp/tmp-toolshed-mtdFbEf6k/pyBamTools/distribute_setup.py", line 123, in _build_egg
    raise IOError('Could not build the egg.')
IOError: Could not build the egg.