Ask Your Question
0

import error on debian

asked 2019-11-16 22:56:32 +0100

stockh0lm gravatar image

I get this error

 sage ~/src/brot.sage
Traceback (most recent call last):
  File "/home/andreas/src/brot.sage.py", line 3, in <module>
    from sage.all_cmdline import *   # import sage library
  File "/usr/lib/python2.7/dist-packages/sage/all_cmdline.py", line 26, in <module>
    from sage.all import *
  File "/usr/lib/python2.7/dist-packages/sage/all.py", line 102, in <module>
    from sage.modular.all    import *
  File "/usr/lib/python2.7/dist-packages/sage/modular/all.py", line 4, in <module>
    from .quatalg.all import *
  File "/usr/lib/python2.7/dist-packages/sage/modular/quatalg/__init__.py", line 4, in <module>
    from . import all
  File "/usr/lib/python2.7/dist-packages/sage/modular/quatalg/all.py", line 3, in <module>
    from .brandt import BrandtModule
  File "/usr/lib/python2.7/dist-packages/sage/modular/quatalg/brandt.py", line 206, in <module>
    from sage.modular.hecke.all import (AmbientHeckeModule, HeckeSubmodule, HeckeModuleElement)
  File "/usr/lib/python2.7/dist-packages/sage/modular/hecke/all.py", line 20, in <module>
    from .ambient_module import AmbientHeckeModule, is_AmbientHeckeModule
  File "/usr/lib/python2.7/dist-packages/sage/modular/hecke/ambient_module.py", line 38, in <module>
    from sage.modular.arithgroup.all import Gamma0 # for Sturm bound
  File "/usr/lib/python2.7/dist-packages/sage/modular/arithgroup/__init__.py", line 4, in <module>
    from . import all
  File "/usr/lib/python2.7/dist-packages/sage/modular/arithgroup/all.py", line 6, in <module>
    from .congroup_generic import is_CongruenceSubgroup, CongruenceSubgroup_constructor as CongruenceSubgroup
  File "/usr/lib/python2.7/dist-packages/sage/modular/arithgroup/congroup_generic.py", line 28, in <module>
    from sage.groups.matrix_gps.all import MatrixGroup
  File "/usr/lib/python2.7/dist-packages/sage/groups/matrix_gps/all.py", line 13, in <module>
    import sage.groups.matrix_gps.pickling_overrides
  File "/usr/lib/python2.7/dist-packages/sage/groups/matrix_gps/pickling_overrides.py", line 7, in <module>
    from sage.groups.matrix_gps.finitely_generated import FinitelyGeneratedMatrixGroup_gap
  File "/usr/lib/python2.7/dist-packages/sage/groups/matrix_gps/finitely_generated.py", line 81, in <module>
    from sage.groups.matrix_gps.matrix_group import (
  File "/usr/lib/python2.7/dist-packages/sage/groups/matrix_gps/matrix_group.py", line 61, in <module>
    from sage.groups.libgap_wrapper import ParentLibGAP
  File "sage/libs/gap/element.pxd", line 32, in init sage.groups.libgap_wrapper (build/cythonized/sage/groups/libgap_wrapper.c:9846)
ImportError: /usr/lib/python2.7/dist-packages/sage/libs/gap/element.x86_64-linux-gnu.so: undefined symbol: _GAP_SetEnterStackCount

with this file: cat brot.sage

R, W, R_S, H, H_S, S = var('R W R_S H H_S S')

equations = [ S                 == R_S + H_S,
              R_S               == H_S,
              (R + R_S + W)     == 3 * R_S,
              0.8*(W+R+R_S)     == H + H_S,
              W/(W+R+R_S)       == 0.6,
              R + W+ S +H       == 0.85]

print solve(equations,[R, W, R_S, H, H_S,S ], algorithm="sympy", solution_dict=False)


sage --version
SageMath version 8.6, Release Date: 2019-01-15

I would like to calculate my bread receipt... what is the issue here? This used to work before.

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
1

answered 2019-12-23 17:01:51 +0100

Iguananaut gravatar image

I recently answered this on the debian-science-sagemath mailing list: https://alioth-lists.debian.net/piper...

It seems you are using Debian testing, which currently has a version mismatch between Sage and GAP which needs to be fixed.

edit flag offensive delete link more
0

answered 2019-12-16 17:32:22 +0100

stockh0lm gravatar image

the brot.sage.py file that gets generated automatically from my brot.sage file looks like this:

# This file was *autogenerated* from the file brot.sage
from sage.all_cmdline import *   # import sage library

_sage_const_3 = Integer(3); _sage_const_0p8 = RealNumber('0.8'); _sage_const_0p85 = RealNumber('0.85'); _sage_const_0p4 = RealNumber('0.4'); _sage_const_0p6 = RealNumber('0.6')
R, W, R_S, H, H_S, S = var('R W R_S H H_S S')

equations = [ S                 == R_S + H_S,
              R_S               == H_S,
              (R + R_S + W)     == _sage_const_3  * R_S,
              _sage_const_0p8 *(W+R+R_S)     == H + H_S,
              W/(W+R+R_S)       == _sage_const_0p6 ,
              R + W+ S +H       == _sage_const_0p85 ]

print solve(equations,[R, W, R_S, H, H_S,S ], algorithm="sympy", solution_dict=False)

And that looks a lot like my input file. It gets re-created if i delete it, too. I see the lines leading up to the stacetrace, too.

Its great that it works for you, though.

Where can start tracking down this problem?

edit flag offensive delete link more

Comments

2

You say "This used to work before." Before what? What has changed? Your version of Sage? Some system software? By the way, how was Sage installed — built from scratch or a binary distribution?

John Palmieri gravatar imageJohn Palmieri ( 2019-12-16 19:36:24 +0100 )edit

i run debian testing on this computer. which is a screw-up on my part. I installed binary packages from debian, and now i have a version mismatch, i guess. i try to figure out which package to install from unstable to fix the issue.

stockh0lm gravatar imagestockh0lm ( 2019-12-16 20:21:59 +0100 )edit
0

answered 2019-11-17 23:39:13 +0100

Emmanuel Charpentier gravatar image

WorksForMe (TM). On Python3-based Sage 9.0.beta5 running on Debian testing:

charpent@zen-book-flip:~$ cat ~/Temporaire/Sagemath/AskSage48780/import-error-on-debian.sage
R, W, R_S, H, H_S, S = var('R W R_S H H_S S')
equations = [ S                 == R_S + H_S,
              R_S               == H_S,
              (R + R_S + W)     == 3 * R_S,
              0.8*(W+R+R_S)     == H + H_S,
              W/(W+R+R_S)       == 0.6,
              R + W+ S +H       == 0.85]
print(solve(equations,[R, W, R_S, H, H_S,S ], algorithm="sympy", solution_dict=False))
charpent@zen-book-flip:~$ sage ~/Temporaire/Sagemath/AskSage48780/import-error-on-debian.sage
[{R: 0.0314814814814815, W: 0.283333333333333, R_S: 0.157407407407407, H: 0.220370370370370, H_S: 0.157407407407407, S: 0.314814814814815}]

You'll note that Sympy insists on giving its solutions as dictionaries...

You'll note that your error stack starts by quoting lines from your input file, whoch bears very little semblance to what you have given us as your input file.

Did you play with hard links recently ? or have had disk troubles ?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2019-11-16 22:56:32 +0100

Seen: 312 times

Last updated: Dec 23 '19