search_def(), search_src() are not working in Sage

63 views
Skip to first unread message

Adarsh Kishore

unread,
Mar 23, 2022, 1:37:20 AM3/23/22
to sage-support
Hello everyone,
I was going through some of the Sage functions and I wanted to look it up in the source file definitions. For this I tried search_def() and then search_src(). In both cases it gave a warning "that the Sage documentation is not available".

Screenshot from 2022-03-23 10-05-04.png

I have tried to look up the official Sage developer's manual, StackOverflow questions and GitHub issues. However, it has not worked out for me, unfortunately.

On the other hand, the search_doc() command works fine for me. This is the output for 
search_doc("add_edges()")
Screenshot from 2022-03-23 10-07-35.png

Is there any documentation that I have to build before I can use these commands? I would appreciate it if someone can give pointers to some helpful links or online documentation where this issue has been addressed.

Emmanuel Charpentier

unread,
Mar 23, 2022, 3:58:34 AM3/23/22
to sage-support
How did you install Sage ? And on what platform ?

slelievre

unread,
Mar 23, 2022, 5:10:28 AM3/23/22
to sage-support
From the screenshot it looks like Ubuntu?

In which case, did you install Sage as an Ubuntu package?
or by building it from source? or via Conda? or in some
other way?

If you installed Sage using Ubuntu's package manager,
by selecting the package `sagemath`, you may also
want to install `sagemath-doc` (and maybe also, though
unrelated to your question here, `sagemath-jupyter`).

If you built Sage from source, the documentation should
have been built, but if it was not, try to build it by running
```
make sagemath_doc_html
```
from the root folder of your Sage installation.

Adarsh Kishore

unread,
Mar 23, 2022, 2:14:45 PM3/23/22
to sage-support
Sorry for not mentioning earlier. My platform is Ubuntu 20.04 LTS and my Sage version is 'SageMath version 9.0, Release Date: 2020-01-01'.

I used 'sudo apt install sagemath sagemath-jupyter sagemath-doc-en'
to install sage along with sagemath-jupyter and sagemath-doc-en

I also cloned the GitHub repository of sage for developers and built it from source. 

slelievre

unread,
Mar 23, 2022, 3:47:52 PM3/23/22
to sage-support
So you installed two versions of Sage, one via
the Ubuntu package manager, the other one
built from source.

When you start Sage, it probably starts the one
installed via the package manager, likely Sage 9.0.

The one you built from source is likely either Sage 9.5
(the latest stable version) or Sage 9.6.beta5 (the latest
development version) if you used the develop branch.

If you want the Sage built from source to be started
rather than the system one, run this command,
assuming you cloned Sage in your home folder
using the default name `sage`:
```
sudo ln -sf $HOME/sage/sage /usr/local/bin
```

Adarsh Kishore

unread,
Mar 23, 2022, 3:52:08 PM3/23/22
to sage-support
I tried running
```
make sagemath_doc_html
```
as instructed. Unfortunately, it does not solve the error.


Screenshot from 2022-03-24 00-39-01.png

Eric Gourgoulhon

unread,
Mar 23, 2022, 4:04:26 PM3/23/22
to sage-support
Hi,

Le mercredi 23 mars 2022 à 20:52:08 UTC+1, adarsh.k...@gmail.com a écrit :
I tried running
```
make sagemath_doc_html
```
as instructed. Unfortunately, it does not solve the error.


You are still running SageMath 9.0, which the version shipped with Ubuntu 20.04.  It is outdated. To fix this,

1/ remove the Ubuntu package "sagemath"

2/ Install SageMath 9.5 by following these simple instructions:

Then search_src, search_def and search_doc will work. 

Eric.

Adarsh Kishore

unread,
Mar 24, 2022, 2:09:18 AM3/24/22
to sage-support
Yes, the problem indeed was that I was using ```make``` on the documentation in the ```develop``` branch which is SageMath v 9.6.beta4, and I was expecting it to run in SageMath 9.0.
In the updated versions, search_def() and search_src() work as expected.

Screenshot from 2022-03-24 09-52-07.png

Screenshot from 2022-03-24 09-52-58.png

Thank you everyone for the help
Reply all
Reply to author
Forward
0 new messages