Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

install package in sage

I want to install the knotinfo database package, see the installation guide in the sagemath documentation on the knotinfo database.

If I type "sage -i database_knotinfo" or "-i database_knotinfo" or "i database_knotinfo" in the Sage console, then I get the error "invalid syntax" as follows:

File "<ipython-input-1-96c1d7170917>", line 1
sage -i database_knotinfo
                            ^
SyntaxError: invalid syntax

All I could find was a post on how to install packages while launching Sage, but I launch Sage by double-clicking the app icon. I also saw something about a "Sage menu" or "command line", but literally all I have is the "SageMath 9.3 Console", so I don't know what to do. Any help is appreciated, thanks.

Edit: I managed to find the Sagemath Shell by right-clicking the app icon, then clicking "open path", then going back in the path to Sagemath. Next, I had to open Sagemath Shell by right-clicking again and choosing "open as administrator". Then I think I was able to install the knotinfo database by typing "pip install database_knotinfo", but I'm not so sure, since it only took a couple seconds and I still can't use knotinfo in the Sage console.

Now I have the problem that when I try to use "from sage.knots.knotinfo import KnotInfo" to get access to knotinfo, I get the following error message:

ModuleNotFoundError Traceback (most recent call last) <ipython-input-1-753febcbc49c> in <module> ----> 1 from sage.knots.knotinfo import KnotInfo

ModuleNotFoundError: No module named 'sage.knots.knotinfo'

What did I do wrong?