"sage -i package_name" not working

asked 2023-08-24 02:45:40 +0200

J Macula gravatar image

updated 2023-08-25 13:46:12 +0200

FrédéricC gravatar image

I've installed the developer's version of sage per the instructions in the installation guide on my mac so that I can install optional packages. Sage appears to be working fine, but when I open a terminal window to execute the command

sage -i database_kohel

the terminal returns "Could not find SageMath-10-0.app." Any help addressing this issue is much appreciated.

edit retag flag offensive close merge delete


In the Terminal you may have to specify the path to the sage executable. (a) Where did you install SageMath? (b) In the Terminal, what does which sage return`?

John Palmieri gravatar imageJohn Palmieri ( 2023-08-24 19:11:35 +0200 )edit

Hi John, thanks for replying. It turns out that once I changed the directory to be the file containing the sage executable, I could get the installation command to work via the command ./sage -i database_kohel. So it seems that I needed to ask terminal to run a command in the executable file?

J Macula gravatar imageJ Macula ( 2023-08-24 19:17:24 +0200 )edit

There may be more than one program called sage on your computer, and Terminal is finding the wrong one by default, one that expects to be connected to SageMath-10-0.app. Using ./sage tells it precisely which one to use, so the problem is avoided. You can set your PATH environment variable so that it knows where to look for sage.

John Palmieri gravatar imageJohn Palmieri ( 2023-08-24 23:04:51 +0200 )edit