Ask Your Question

Revision history [back]

How to load optional gap packages

I would like to use the GAP package HAP in Sage. This is used, for example, to calculate cohomology of permutation groups as in (from the sage reference manual):

sage: G = SymmetricGroup(4)
sage: G.cohomology(1,2)                            # optional - gap_packages

In Sage 5.10, this raises

RuntimeError: Error loading Gap package hap. You may want to install the gap_packages SPKG.

Note that this is the error after installing gap_packages with sage -i gap_packages. I verified this with sage -optional, which gives:

Using SAGE Server http://www.sagemath.org/packages
 ***********************************
    ***  optional Packages   ***
 ***********************************

INSTALLED:
gap_packages-4.5.7

NOT INSTALLED:
4ti2-1.3.2.p1
autotools-20121217
beautifulsoup-3.2.1
biopython-1.61
...

Now I can track this error a little bit, to find the following bugs:

sage: from sage.groups.perm_gps.permgroup import load_hap
sage: load_hap()
...
RuntimeError: Error loading Gap package hap. You may want to install the gap_packages SPKG.

sage: gap.eval('LoadPackage("hap")')
'fail'
sage: gap.eval('LoadPackage("HAP")')
'fail'
sage: gap.eval('LoadPackage("Hap")')
'fail'
sage: gap.eval('LoadPackage("Hap1.10")')
'fail'

That last guess comes from listing the contents of SAGEROOT//local/gap/gap-4.5.7/pkg/, but seems to not work. Moreover, when I run gap directly with sage -gap, loading HAP fails there too. When I run LoadAllPackages(); in gap, HAP is not on the list of those that load.

How to load optional gap packages

I would like to use the GAP package HAP in Sage. This is used, for example, to calculate cohomology of permutation groups as in (from the sage reference manual):

sage: G = SymmetricGroup(4)
sage: G.cohomology(1,2)                            # optional - gap_packages

In Sage 5.10, this raises

RuntimeError: Error loading Gap package hap. You may want to install the gap_packages SPKG.

Note that this is the error after installing gap_packages with sage -i gap_packages. I verified this with sage -optional, which gives:

Using SAGE Server http://www.sagemath.org/packages
 ***********************************
    ***  optional Packages   ***
 ***********************************

INSTALLED:
gap_packages-4.5.7

NOT INSTALLED:
4ti2-1.3.2.p1
autotools-20121217
beautifulsoup-3.2.1
biopython-1.61
...

Now I can track this error a little bit, to find the following bugs:

sage: from sage.groups.perm_gps.permgroup import load_hap
sage: load_hap()
...
RuntimeError: Error loading Gap package hap. You may want to install the gap_packages SPKG.

sage: gap.eval('LoadPackage("hap")')
'fail'
sage: gap.eval('LoadPackage("HAP")')
'fail'
sage: gap.eval('LoadPackage("Hap")')
'fail'
sage: gap.eval('LoadPackage("Hap1.10")')
'fail'

That last guess comes from listing the contents of SAGEROOT//local/gap/gap-4.5.7/pkg/, but seems to not work. Moreover, when I run gap directly with sage -gap, loading HAP fails there too. When I run LoadAllPackages(); in gap, HAP is not on the list of those that load.

How to load optional gap packages

I would like to use the GAP package HAP in Sage. This is used, for example, to calculate cohomology of permutation groups as in (from the sage reference manual):

sage: G = SymmetricGroup(4)
sage: G.cohomology(1,2)                            # optional - gap_packages

In Sage 5.10, this raises

RuntimeError: Error loading Gap package hap. You may want to install the gap_packages SPKG.

Note that this is the error after installing gap_packages with sage -i gap_packages. I verified this with sage -optional, which gives:

Using SAGE Server http://www.sagemath.org/packages
 ***********************************
    ***  optional Packages   ***
 ***********************************

INSTALLED:
gap_packages-4.5.7

NOT INSTALLED:
4ti2-1.3.2.p1
autotools-20121217
beautifulsoup-3.2.1
biopython-1.61
...

Now I can track this error a little bit, to find the following bugs:

sage: from sage.groups.perm_gps.permgroup import load_hap
sage: load_hap()
...
RuntimeError: Error loading Gap package hap. You may want to install the gap_packages SPKG.

sage: gap.eval('LoadPackage("hap")')
'fail'
sage: gap.eval('LoadPackage("HAP")')
'fail'
sage: gap.eval('LoadPackage("Hap")')
'fail'
sage: gap.eval('LoadPackage("Hap1.10")')
'fail'

That last guess comes from listing the contents of SAGEROOT//local/gap/gap-4.5.7/pkg/, but seems to not work. Moreover, when I run gap directly with sage -gap, loading HAP fails there too. When I run LoadAllPackages(); in gap, HAP is not on the list of those that load.