title: SAGE: Finding the Automorphism Group of a Permutation Group
body: <p>I'd like to compute the automorphism group of a permutation group in Sage. For example, in GAP I can compute the following:</p>
  
  <pre><code>grp := Group([ (1,2,3,4,5), (1,2,4,3) ]);
  aut := AutomorphismGroup(grp);
  
  Group( [ GroupHomomorphismByImages( Group( [ (1,2,3,4,5), (1,2,4,3) ] ), Group( [ (1,2,3,4,5), (1,2,4,3) ] ), Pcgs(
      [ (2,3,5,4), (2,5)(3,4), (1,2,3,4,5) ]), [ (2,3,5,4), (2,5)(3,4), (1,3,5,2,4) ] ),
    GroupHomomorphismByImages( Group( [ (1,2,3,4,5), (1,2,4,3) ] ), Group( [ (1,2,3,4,5), (1,2,4,3) ] ), Pcgs(
      [ (2,3,5,4), (2,5)(3,4), (1,2,3,4,5) ]), [ (2,3,5,4), (2,5)(3,4), (1,5,4,3,2) ] ),
    GroupHomomorphismByImages( Group( [ (1,2,3,4,5), (1,2,4,3) ] ), Group( [ (1,2,3,4,5), (1,2,4,3) ] ), Pcgs(
      [ (2,3,5,4), (2,5)(3,4), (1,2,3,4,5) ]), [ (1,2,4,3), (1,4)(2,3), (1,2,3,4,5) ] ) ] )
  </code></pre>
  
  <p>After some searching, it appears there's no function written in Sage to do this; however, I stumbled across this question (and answer) on this site: <a href="https://stackoverflow.com/questions/48672107/sage-automorphism-group-of-finite-abelian-group">SAGE: Automorphism group of finite abelian group?</a></p>
  
  <p>The suggestion is to do the following:</p>
  
  <pre><code>grp = PermutationGroup([ '(1,2,3,4,5)', '(1,2,4,3)' ])
  H = gap(grp).AutomorphismGroup()
  PermutationGroup(gap_group = H.AsPermGroup())
  
  Permutation Group with generators [(2,3,5,4), (2,5)(3,4), (1,5,4,3,2)]
  </code></pre>
  
  <p>I cannot get this code to work. I'm running Sage 8.9 on Windows 10. When I put the above code into Sage Cell Server (<a href="https://sagecell.sagemath.org/" rel="nofollow noreferrer">https://sagecell.sagemath.org/</a>) it works just fine. When I run it in my installed copy, I get the following error output:</p>
  
  <pre><code>RuntimeError: Gap produced error output
  Error, Variable: 'AsPermGroup' must have a value
  
     executing __SAGE_LAST__:="__SAGE_LAST__";;AsPermGroup(\$sage3);;
  </code></pre>
  
  <p>I really need to get this to work. Is this an issue with Sage 8.9 via Windows?</p>