Neil, 
AFAIK, python will not load a module unless the relevant script file is marked as executable by the current user?
Try something like:
chmod ugo+x scripts/db_shell.py
and see if that fixes your problem?



On Tue, Apr 30, 2013 at 11:50 AM, <Neil.Burdett@csiro.au> wrote:
Hi,
    I'm trying to use the tool, however, when I run it I get:


python create_galaxy_users.py

Traceback (most recent call last):
  File "create_galaxy_users.py", line 2, in <module>
    from scripts.db_shell import *
ImportError: No module named scripts.db_shell

I've set my PYTHONPATH to be ~/galaxy-dist/lib. What else do I need to do? I'm running the script from ~/galaxy-dist/ directory, but I get the same error if I copy it into the scripts directory. I've checked and I can see that the scripts.db_shell.py script exists

If I comment out the line then the next error I get is:

python create_galaxy_users.py
Traceback (most recent call last):
  File "create_galaxy_users.py", line 7, in <module>
    from galaxy.security import GalaxyRBACAgent
  File "/home/galaxy/galaxy-dist/lib/galaxy/security/__init__.py", line 9, in <module>
    from galaxy.model.orm import *
  File "/home/galaxy/galaxy-dist/lib/galaxy/model/__init__.py", line 15, in <module>
    from galaxy.security import RBACAgent, get_permitted_actions
ImportError: cannot import name RBACAgent

Any help much appreciated

Neil
----------------------------------------------------------------------

Message: 1
Date: Sat, 27 Apr 2013 14:07:49 -0500
From: John Chilton <chilton@msi.umn.edu>
To: Adam Brenner <aebrenne@uci.edu>
Cc: "galaxy-dev@lists.bx.psu.edu" <galaxy-dev@lists.bx.psu.edu>
Subject: Re: [galaxy-dev] Command Line Tool for Creating New Users
Message-ID:
        <CANwbokctvXO-DFmamr77FU6BbDHGR1STG7mpH_LP+fE2nMcnag@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

I put together a script to do this. It is described in the galaxy-dev thread titled: "[galaxy-dev] user creation using API". It doesn't actually use the API, it uses the db_shell.py script.

Hope this helps.

-John