# Trouble importing groups from GAP

I would like to use groups from the GAP library in Sage; something like:

```
sage: L = gap.AllGroups(16)
sage: G = PermutationGroup(gap_group = L[1])
```

and use `G`

in my sage code. But I must be doing something wrong, becuase I get:

```
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-32-14053049143a> in <module>()
----> 1 G = PermutationGroup(gap_group = L[Integer(1)])
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/groups/perm_gps/permgroup.pyc in PermutationGroup(gens, gap_group, domain, canonicalize, category)
335 raise TypeError("gens must be a tuple, list, or GapElement")
336 return PermutationGroup_generic(gens=gens, gap_group=gap_group, domain=domain,
--> 337 canonicalize=canonicalize, category=category)
338
339
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/groups/perm_gps/permgroup.pyc in __init__(self, gens, gap_group, canonicalize, domain, category)
404
405 if domain is None:
--> 406 gens = [standardize_generator(x) for x in gens]
407 domain = set()
408 for x in gens:
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/groups/perm_gps/permgroup_element.so in sage.groups.perm_gps.permgroup_element.standardize_generator (build/cythonized/sage/groups/perm_gps/permgroup_element.c:3761)()
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/groups/perm_gps/permgroup_element.so in sage.groups.perm_gps.permgroup_element.string_to_tuples (build/cythonized/sage/groups/perm_gps/permgroup_element.c:3362)()
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/misc/sage_eval.pyc in sage_eval(source, locals, cmds, preparse)
197 return locals['_sage_eval_returnval_']
198 else:
--> 199 return eval(source, sage.all.__dict__, locals)
200
201
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/all.pyc in <module>()
NameError: name 'f1' is not defined
```

What is the correct way to do this?