Ask Your Question

wayneyam's profile - activity

2024-02-22 12:01:54 +0200 received badge  Famous Question (source)
2023-11-05 17:55:26 +0200 received badge  Student (source)
2023-11-05 04:42:22 +0200 asked a question How do you use sage efficiently?

How do you use sage efficiently? I feel like my current workflow has a lot to optimize. I currently use Neovim with the

2023-08-16 21:41:47 +0200 received badge  Notable Question (source)
2023-05-25 15:37:43 +0200 received badge  Popular Question (source)
2023-02-12 05:58:33 +0200 marked best answer Python3.11 Cpython issue, can't open app

I'm not a native speaker, sorry for poor English

I installed sagemath through sudo apt install sagemath yesterday and tried to import sage.all from python, however I was hit with

Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3/dist-packages/sage/all.py", line 83, in <module>
        import sage.misc.lazy_import
ModuleNotFoundError: No module named 'sage.misc.lazy_import'

After a bit of work I found that .pyx files can't be imported, and import pyximport; pyximport.install() works to mitigate that error, however I was hit with another error:

Traceback (most recent call last):
  File "/home/wayne/.local/lib/python3.11/site-packages/pyximport/pyximport.py", line 216, in load_module
    mod = imp.load_dynamic(name, so_path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/imp.py", line 343, in load_dynamic
    return _load(spec)
           ^^^^^^^^^^^
ImportError: /home/wayne/.pyxbld/lib.linux-x86_64-cpython-311/sage/misc/randstate.cpython-311-x86_64-linux-   gnu.so: undefined symbol: __gmp_randclear

Which I suppose is still related to Cython, I wasn't able to resolve this.

When running sage in terminal here's the output

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.0, Release Date: 2020-01-01                     │
│ Using Python 3.11.1. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘

 Traceback (most recent call last):
  File "/usr/share/sagemath/bin/sage-ipython", line 12, in <module>
    from sage.repl.interpreter import SageTerminalApp
  File "/usr/lib/python3/dist-packages/sage/repl/interpreter.py", line 105, in <module>
    from sage.repl.preparse import preparse, containing_block
  File "/usr/lib/python3/dist-packages/sage/repl/preparse.py", line 227, in <module>
    from sage.repl.load import load_wrap
  File "/usr/lib/python3/dist-packages/sage/repl/load.py", line 19, in <module>
    from sage.cpython.string import str_to_bytes, bytes_to_str, FS_ENCODING
ModuleNotFoundError: No module named 'sage.cpython.string'

After this I tried to import sage.cpython.string python

/home/wayne/.pyxbld/temp.linux-x86_64-cpython-311/pyrex/sage/cpython/string.c:744:10: fatal error: string_impl.h: No such file or directory
  744 | #include "string_impl.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.

I think these are all somehow related, I was not able to resolve them, any ideas are appreciated

2023-02-10 10:36:43 +0200 marked best answer how to use "Sage Notebook"

The official tutorial says:

from the Sage notebook click Help, then click Tutorial to interactively work through the tutorial from within Sage.

For the life of me I can not figure out how to do this, I'm using sagemath-9.8.rc1

Also it says I can view the tutorial in PDF format, I also couldn't find it

2023-02-10 10:36:43 +0200 received badge  Scholar (source)
2023-02-10 08:26:34 +0200 received badge  Editor (source)
2023-02-10 08:26:34 +0200 edited question how to use "Sage Notebook"

how to use "Sage Notebook" The official tutorial says: from the Sage notebook click Help, then click Tutorial to inte

2023-02-10 08:20:50 +0200 asked a question how to use "Sage Notebook"

how to use "Sage Notebook" The official tutorial says: from the Sage notebook click Help, then click Tutorial to inte

2023-02-09 05:43:48 +0200 asked a question Python3.11 Cpython issue, can't open app

Python3.11 Cpython issue, can't open app I'm not a native speaker, sorry for poor English I installed sagemath through