can't load a saved file

asked 2020-10-05 02:20:24 +0200

cybervigilante gravatar image

I saved a function as hypotenuse.sobj and it shows up in the local directory listing. Then I tried load("hypotenuse.sobj") and get this error:

AttributeError: Can't get attribute 'dist' on <module 'sage.all_cmdline'="" from="" '="" opt="" sagemath-9.1="" local="" lib="" python3.7="" site-packages="" sage="" all_cmdline.py'="">

edit retag flag offensive close merge delete

Comments

To display blocks of code or error messages in Ask Sage, skip a line above and below, and do one of the following (all give the same result):

  • indent all code lines with 4 spaces
  • select all code lines and click the "code" button (the icon with '101 010')
  • select all code lines and hit ctrl-K

For instance, typing

If we define `f` by

    def f(x, y, z):
        return x * y * z

then `f(2, 3, 5)` returns `30` but `f(2*3*5)` gives:

    TypeError: f() takes exactly 3 arguments (1 given)

produces:

If we define f by

def f(x, y, z):
    return x * y * z

then f(2, 3, 5) returns 30 but f(2*3*5) gives:

TypeError: f() takes exactly 3 arguments (1 given)

Please edit your question to do that.

slelievre gravatar imageslelievre ( 2020-10-06 00:45:08 +0200 )edit

Hard to say much about the problem without a reproducible set of commands.

Ideally, trim down the function to a minimal example that triggers this error.

Then share that minimal example.

slelievre gravatar imageslelievre ( 2020-10-06 10:40:56 +0200 )edit