ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 02 Aug 2020 04:05:41 +0200SageMath on macOS: app, components, packages, SageTeXhttps://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/I'm brand new to SageMath and having trouble getting my bearings.
Can you help with these things:
- On macOS 10.14.6, I downloaded and installed
`sage-9.1-OSX_10.11.6-X86_64.app.dmg` from the
[SageMath download mirror at MIT](https://mirrors.mit.edu/sage/osx/intel/index.html).
But although the app starts the way the page says, "like most other
Mac applications," the interface is quite different from most other
Mac applications. Instead of the usual sequence,
"**AppName**, **File**, **Edit**, **View**, ... **Window**, **Help**,"
Sage has "**Sage**, **File**, **Server**, **Terminal Session**, **Development**, **Help**."
I recognize "**Sage**," "**File**," and "**Help**," but not the rest.
Is there introductory documentation or a tutorial somewhere
that explains how to use Sage from this interface?
- Regarding the installation itself, the
[SageMath components documentation](https://www.sagemath.org/links-components.html)
lists 84 separate components. Some of these, like R and Python,
I already have installed and use regularly in different contexts.
Does SageMath install duplicates, or does it use the already installed
versions? And in either case, how does SageMath handle component
updates and possible incompatibilities associated with them?
- I want to use SageMath with [LyX](https://www.lyx.org/)
and therefore need SageTeX. In the SageMath documentation, the
[SageTeX tutorial](https://doc.sagemath.org/html/en/tutorial/sagetex.html#sec-sagetex-install)
says SageMath comes with SageTeX, and all one needs to do
is to make TeX aware of it. But the page refers to `SAGE_ROOT`,
and since I installed using the `.dmg` file, I'm not really sure
where `SAGE_ROOT` is. How does one find it?Fri, 31 Jul 2020 18:07:54 +0200https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/Comment by slelievre for <p>I'm brand new to SageMath and having trouble getting my bearings.
Can you help with these things:</p>
<ul>
<li><p>On macOS 10.14.6, I downloaded and installed
<code>sage-9.1-OSX_10.11.6-X86_64.app.dmg</code> from the
<a href="https://mirrors.mit.edu/sage/osx/intel/index.html">SageMath download mirror at MIT</a>.
But although the app starts the way the page says, "like most other
Mac applications," the interface is quite different from most other
Mac applications. Instead of the usual sequence,
"<strong>AppName</strong>, <strong>File</strong>, <strong>Edit</strong>, <strong>View</strong>, ... <strong>Window</strong>, <strong>Help</strong>,"
Sage has "<strong>Sage</strong>, <strong>File</strong>, <strong>Server</strong>, <strong>Terminal Session</strong>, <strong>Development</strong>, <strong>Help</strong>."
I recognize "<strong>Sage</strong>," "<strong>File</strong>," and "<strong>Help</strong>," but not the rest.
Is there introductory documentation or a tutorial somewhere
that explains how to use Sage from this interface?</p></li>
<li><p>Regarding the installation itself, the
<a href="https://www.sagemath.org/links-components.html">SageMath components documentation</a>
lists 84 separate components. Some of these, like R and Python,
I already have installed and use regularly in different contexts.
Does SageMath install duplicates, or does it use the already installed
versions? And in either case, how does SageMath handle component
updates and possible incompatibilities associated with them?</p></li>
<li><p>I want to use SageMath with <a href="https://www.lyx.org/">LyX</a>
and therefore need SageTeX. In the SageMath documentation, the
<a href="https://doc.sagemath.org/html/en/tutorial/sagetex.html#sec-sagetex-install">SageTeX tutorial</a>
says SageMath comes with SageTeX, and all one needs to do
is to make TeX aware of it. But the page refers to <code>SAGE_ROOT</code>,
and since I installed using the <code>.dmg</code> file, I'm not really sure
where <code>SAGE_ROOT</code> is. How does one find it?</p></li>
</ul>
https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52791#post-id-52791@dazedANDconfused --- CoCalc does make it easy! Thanks for mentioning it!
But it's also nice to be able to work on one's computer and not depend on internet access.Sat, 01 Aug 2020 02:50:03 +0200https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52791#post-id-52791Comment by slelievre for <p>I'm brand new to SageMath and having trouble getting my bearings.
Can you help with these things:</p>
<ul>
<li><p>On macOS 10.14.6, I downloaded and installed
<code>sage-9.1-OSX_10.11.6-X86_64.app.dmg</code> from the
<a href="https://mirrors.mit.edu/sage/osx/intel/index.html">SageMath download mirror at MIT</a>.
But although the app starts the way the page says, "like most other
Mac applications," the interface is quite different from most other
Mac applications. Instead of the usual sequence,
"<strong>AppName</strong>, <strong>File</strong>, <strong>Edit</strong>, <strong>View</strong>, ... <strong>Window</strong>, <strong>Help</strong>,"
Sage has "<strong>Sage</strong>, <strong>File</strong>, <strong>Server</strong>, <strong>Terminal Session</strong>, <strong>Development</strong>, <strong>Help</strong>."
I recognize "<strong>Sage</strong>," "<strong>File</strong>," and "<strong>Help</strong>," but not the rest.
Is there introductory documentation or a tutorial somewhere
that explains how to use Sage from this interface?</p></li>
<li><p>Regarding the installation itself, the
<a href="https://www.sagemath.org/links-components.html">SageMath components documentation</a>
lists 84 separate components. Some of these, like R and Python,
I already have installed and use regularly in different contexts.
Does SageMath install duplicates, or does it use the already installed
versions? And in either case, how does SageMath handle component
updates and possible incompatibilities associated with them?</p></li>
<li><p>I want to use SageMath with <a href="https://www.lyx.org/">LyX</a>
and therefore need SageTeX. In the SageMath documentation, the
<a href="https://doc.sagemath.org/html/en/tutorial/sagetex.html#sec-sagetex-install">SageTeX tutorial</a>
says SageMath comes with SageTeX, and all one needs to do
is to make TeX aware of it. But the page refers to <code>SAGE_ROOT</code>,
and since I installed using the <code>.dmg</code> file, I'm not really sure
where <code>SAGE_ROOT</code> is. How does one find it?</p></li>
</ul>
https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52782#post-id-52782Welcome to SageMath! Welcome to Ask Sage! Thank you for your question!Fri, 31 Jul 2020 23:00:06 +0200https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52782#post-id-52782Comment by slelievre for <p>I'm brand new to SageMath and having trouble getting my bearings.
Can you help with these things:</p>
<ul>
<li><p>On macOS 10.14.6, I downloaded and installed
<code>sage-9.1-OSX_10.11.6-X86_64.app.dmg</code> from the
<a href="https://mirrors.mit.edu/sage/osx/intel/index.html">SageMath download mirror at MIT</a>.
But although the app starts the way the page says, "like most other
Mac applications," the interface is quite different from most other
Mac applications. Instead of the usual sequence,
"<strong>AppName</strong>, <strong>File</strong>, <strong>Edit</strong>, <strong>View</strong>, ... <strong>Window</strong>, <strong>Help</strong>,"
Sage has "<strong>Sage</strong>, <strong>File</strong>, <strong>Server</strong>, <strong>Terminal Session</strong>, <strong>Development</strong>, <strong>Help</strong>."
I recognize "<strong>Sage</strong>," "<strong>File</strong>," and "<strong>Help</strong>," but not the rest.
Is there introductory documentation or a tutorial somewhere
that explains how to use Sage from this interface?</p></li>
<li><p>Regarding the installation itself, the
<a href="https://www.sagemath.org/links-components.html">SageMath components documentation</a>
lists 84 separate components. Some of these, like R and Python,
I already have installed and use regularly in different contexts.
Does SageMath install duplicates, or does it use the already installed
versions? And in either case, how does SageMath handle component
updates and possible incompatibilities associated with them?</p></li>
<li><p>I want to use SageMath with <a href="https://www.lyx.org/">LyX</a>
and therefore need SageTeX. In the SageMath documentation, the
<a href="https://doc.sagemath.org/html/en/tutorial/sagetex.html#sec-sagetex-install">SageTeX tutorial</a>
says SageMath comes with SageTeX, and all one needs to do
is to make TeX aware of it. But the page refers to <code>SAGE_ROOT</code>,
and since I installed using the <code>.dmg</code> file, I'm not really sure
where <code>SAGE_ROOT</code> is. How does one find it?</p></li>
</ul>
https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52783#post-id-52783I turned the urls into links in the question, and made other minor edits.
If you disapprove any of those, please feel free to edit back.Fri, 31 Jul 2020 23:02:06 +0200https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52783#post-id-52783Comment by dazedANDconfused for <p>I'm brand new to SageMath and having trouble getting my bearings.
Can you help with these things:</p>
<ul>
<li><p>On macOS 10.14.6, I downloaded and installed
<code>sage-9.1-OSX_10.11.6-X86_64.app.dmg</code> from the
<a href="https://mirrors.mit.edu/sage/osx/intel/index.html">SageMath download mirror at MIT</a>.
But although the app starts the way the page says, "like most other
Mac applications," the interface is quite different from most other
Mac applications. Instead of the usual sequence,
"<strong>AppName</strong>, <strong>File</strong>, <strong>Edit</strong>, <strong>View</strong>, ... <strong>Window</strong>, <strong>Help</strong>,"
Sage has "<strong>Sage</strong>, <strong>File</strong>, <strong>Server</strong>, <strong>Terminal Session</strong>, <strong>Development</strong>, <strong>Help</strong>."
I recognize "<strong>Sage</strong>," "<strong>File</strong>," and "<strong>Help</strong>," but not the rest.
Is there introductory documentation or a tutorial somewhere
that explains how to use Sage from this interface?</p></li>
<li><p>Regarding the installation itself, the
<a href="https://www.sagemath.org/links-components.html">SageMath components documentation</a>
lists 84 separate components. Some of these, like R and Python,
I already have installed and use regularly in different contexts.
Does SageMath install duplicates, or does it use the already installed
versions? And in either case, how does SageMath handle component
updates and possible incompatibilities associated with them?</p></li>
<li><p>I want to use SageMath with <a href="https://www.lyx.org/">LyX</a>
and therefore need SageTeX. In the SageMath documentation, the
<a href="https://doc.sagemath.org/html/en/tutorial/sagetex.html#sec-sagetex-install">SageTeX tutorial</a>
says SageMath comes with SageTeX, and all one needs to do
is to make TeX aware of it. But the page refers to <code>SAGE_ROOT</code>,
and since I installed using the <code>.dmg</code> file, I'm not really sure
where <code>SAGE_ROOT</code> is. How does one find it?</p></li>
</ul>
https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52789#post-id-52789The easiest way to get up and running with Sage and `sagetex` is with a free [Cocalc account](https://cocalc.com/). This avoids the sort of technical issues you're experiencing now.Sat, 01 Aug 2020 02:37:13 +0200https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52789#post-id-52789Answer by slelievre for <p>I'm brand new to SageMath and having trouble getting my bearings.
Can you help with these things:</p>
<ul>
<li><p>On macOS 10.14.6, I downloaded and installed
<code>sage-9.1-OSX_10.11.6-X86_64.app.dmg</code> from the
<a href="https://mirrors.mit.edu/sage/osx/intel/index.html">SageMath download mirror at MIT</a>.
But although the app starts the way the page says, "like most other
Mac applications," the interface is quite different from most other
Mac applications. Instead of the usual sequence,
"<strong>AppName</strong>, <strong>File</strong>, <strong>Edit</strong>, <strong>View</strong>, ... <strong>Window</strong>, <strong>Help</strong>,"
Sage has "<strong>Sage</strong>, <strong>File</strong>, <strong>Server</strong>, <strong>Terminal Session</strong>, <strong>Development</strong>, <strong>Help</strong>."
I recognize "<strong>Sage</strong>," "<strong>File</strong>," and "<strong>Help</strong>," but not the rest.
Is there introductory documentation or a tutorial somewhere
that explains how to use Sage from this interface?</p></li>
<li><p>Regarding the installation itself, the
<a href="https://www.sagemath.org/links-components.html">SageMath components documentation</a>
lists 84 separate components. Some of these, like R and Python,
I already have installed and use regularly in different contexts.
Does SageMath install duplicates, or does it use the already installed
versions? And in either case, how does SageMath handle component
updates and possible incompatibilities associated with them?</p></li>
<li><p>I want to use SageMath with <a href="https://www.lyx.org/">LyX</a>
and therefore need SageTeX. In the SageMath documentation, the
<a href="https://doc.sagemath.org/html/en/tutorial/sagetex.html#sec-sagetex-install">SageTeX tutorial</a>
says SageMath comes with SageTeX, and all one needs to do
is to make TeX aware of it. But the page refers to <code>SAGE_ROOT</code>,
and since I installed using the <code>.dmg</code> file, I'm not really sure
where <code>SAGE_ROOT</code> is. How does one find it?</p></li>
</ul>
https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?answer=52779#post-id-52779### Docs for SageMath macOS interface
Thanks for pointing out the need for better documentation
of the SageMath macOS app interface.
### SageMath components
Regarding components, the answer is: SageMath ships its own components.
Suggestions once you have installed the macOS SageMath app:
- create a symbolic link to the sage executable somewhere in your `PATH`
The easiest way to do that is by running the following command
from inside Sage:
sage: !ln -sf $SAGE_ROOT/sage /usr/local/bin
Then when asked, type the password for the current macOS user
(this should be run by a user who is an admin for that Mac).
Once that is done, you can start the Sage REPL (read-eval-print loop,
also known as "command-line interface" or "Sage in the terminal")
in any terminal session by using the command `sage`.
- fix your Sage using the T3M group's `fix_mac_sage`
- [T3M / fix_mac_sage](https://github.com/3-manifolds/fix_mac_sage)
That will enable SSL and Tkinter for the Python shipped by Sage.
SSL is useful for secure downloads, in particular for using `pip`,
the Python package installer.
Tkinter is a graphical interface toolkit for Python, used by some
optional packages of Sage, such as SnapPy.
- to install extra pip packages, use the `pip` command
One way to do that is from inside a Sage session:
sage: !pip install some_package_name
Another way is in a shell session (without starting Sage):
$ sage --pip install some_package_name
- to install extra R packages, start Sage's R
$ sage --R
and do as you would in R.
- to install extra GAP packages,
- install the optional package `gap_packages`
$ sage -i gap_packages
- start Sage's GAP
$ sage --gap
and use the GAP package `PackageManager` as you would in GAP.
### SageTeX for the macOS SageMath app
Follow the instructions on the documentation page you mentioned.
Two ways to find `SAGE_ROOT`:
- in a Sage session:
sage: print(SAGE_ROOT)
- in a shell session:
$ sage -c 'print(SAGE_ROOT)'
### Other tips for SageMath on macOS
- Install JupyterLab
sage: !pip install jupyterlab
You can then start Sage in JupyterLab
- Install RISE
sage: !pip install RISE
You can then turn Jupyter notebooks into presentations.
Currently works with Jupyter Notebook but not with JupyterLab.
Fri, 31 Jul 2020 21:28:25 +0200https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?answer=52779#post-id-52779Comment by Emmanuel Charpentier for <h3>Docs for SageMath macOS interface</h3>
<p>Thanks for pointing out the need for better documentation
of the SageMath macOS app interface.</p>
<h3>SageMath components</h3>
<p>Regarding components, the answer is: SageMath ships its own components.</p>
<p>Suggestions once you have installed the macOS SageMath app:</p>
<ul>
<li><p>create a symbolic link to the sage executable somewhere in your <code>PATH</code></p>
<p>The easiest way to do that is by running the following command
from inside Sage:</p>
<pre><code>sage: !ln -sf $SAGE_ROOT/sage /usr/local/bin
</code></pre>
<p>Then when asked, type the password for the current macOS user
(this should be run by a user who is an admin for that Mac).</p>
<p>Once that is done, you can start the Sage REPL (read-eval-print loop,
also known as "command-line interface" or "Sage in the terminal")
in any terminal session by using the command <code>sage</code>.</p></li>
<li><p>fix your Sage using the T3M group's <code>fix_mac_sage</code></p>
<ul>
<li><a href="https://github.com/3-manifolds/fix_mac_sage">T3M / fix_mac_sage</a></li>
</ul>
<p>That will enable SSL and Tkinter for the Python shipped by Sage.</p>
<p>SSL is useful for secure downloads, in particular for using <code>pip</code>,
the Python package installer.</p>
<p>Tkinter is a graphical interface toolkit for Python, used by some
optional packages of Sage, such as SnapPy.</p></li>
<li><p>to install extra pip packages, use the <code>pip</code> command</p>
<p>One way to do that is from inside a Sage session:</p>
<pre><code>sage: !pip install some_package_name
</code></pre>
<p>Another way is in a shell session (without starting Sage):</p>
<pre><code>$ sage --pip install some_package_name
</code></pre></li>
<li><p>to install extra R packages, start Sage's R</p>
<pre><code>$ sage --R
</code></pre>
<p>and do as you would in R.</p></li>
<li><p>to install extra GAP packages,</p>
<ul>
<li><p>install the optional package <code>gap_packages</code></p>
<pre><code>$ sage -i gap_packages
</code></pre></li>
<li><p>start Sage's GAP</p>
<p>$ sage --gap</p></li>
</ul>
<p></p><p>and use the GAP package <code>PackageManager</code> as you would in GAP.</p></li>
</ul><p></p>
<h3>SageTeX for the macOS SageMath app</h3>
<p>Follow the instructions on the documentation page you mentioned.</p>
<p>Two ways to find <code>SAGE_ROOT</code>:</p>
<ul>
<li><p>in a Sage session:</p>
<pre><code>sage: print(SAGE_ROOT)
</code></pre></li>
<li><p>in a shell session:</p>
<pre><code>$ sage -c 'print(SAGE_ROOT)'
</code></pre></li>
</ul>
<h3>Other tips for SageMath on macOS</h3>
<ul>
<li><p>Install JupyterLab</p>
<pre><code>sage: !pip install jupyterlab
</code></pre>
<p>You can then start Sage in JupyterLab</p></li>
<li><p>Install RISE</p>
<pre><code>sage: !pip install RISE
</code></pre>
<p>You can then turn Jupyter notebooks into presentations.</p>
<p>Currently works with Jupyter Notebook but not with JupyterLab.</p></li>
</ul>
https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52798#post-id-52798While I can't comment *knowngly* about this comment (I won't touch macOS with a 10-feet pole...), it seems exceedingly useful for macOS users.
May I suggest you to turn it in a piece of official Sagemath documentatipn, possibly with a reference in `README.md` ?Sat, 01 Aug 2020 19:29:52 +0200https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52798#post-id-52798Comment by slelievre for <h3>Docs for SageMath macOS interface</h3>
<p>Thanks for pointing out the need for better documentation
of the SageMath macOS app interface.</p>
<h3>SageMath components</h3>
<p>Regarding components, the answer is: SageMath ships its own components.</p>
<p>Suggestions once you have installed the macOS SageMath app:</p>
<ul>
<li><p>create a symbolic link to the sage executable somewhere in your <code>PATH</code></p>
<p>The easiest way to do that is by running the following command
from inside Sage:</p>
<pre><code>sage: !ln -sf $SAGE_ROOT/sage /usr/local/bin
</code></pre>
<p>Then when asked, type the password for the current macOS user
(this should be run by a user who is an admin for that Mac).</p>
<p>Once that is done, you can start the Sage REPL (read-eval-print loop,
also known as "command-line interface" or "Sage in the terminal")
in any terminal session by using the command <code>sage</code>.</p></li>
<li><p>fix your Sage using the T3M group's <code>fix_mac_sage</code></p>
<ul>
<li><a href="https://github.com/3-manifolds/fix_mac_sage">T3M / fix_mac_sage</a></li>
</ul>
<p>That will enable SSL and Tkinter for the Python shipped by Sage.</p>
<p>SSL is useful for secure downloads, in particular for using <code>pip</code>,
the Python package installer.</p>
<p>Tkinter is a graphical interface toolkit for Python, used by some
optional packages of Sage, such as SnapPy.</p></li>
<li><p>to install extra pip packages, use the <code>pip</code> command</p>
<p>One way to do that is from inside a Sage session:</p>
<pre><code>sage: !pip install some_package_name
</code></pre>
<p>Another way is in a shell session (without starting Sage):</p>
<pre><code>$ sage --pip install some_package_name
</code></pre></li>
<li><p>to install extra R packages, start Sage's R</p>
<pre><code>$ sage --R
</code></pre>
<p>and do as you would in R.</p></li>
<li><p>to install extra GAP packages,</p>
<ul>
<li><p>install the optional package <code>gap_packages</code></p>
<pre><code>$ sage -i gap_packages
</code></pre></li>
<li><p>start Sage's GAP</p>
<p>$ sage --gap</p></li>
</ul>
<p></p><p>and use the GAP package <code>PackageManager</code> as you would in GAP.</p></li>
</ul><p></p>
<h3>SageTeX for the macOS SageMath app</h3>
<p>Follow the instructions on the documentation page you mentioned.</p>
<p>Two ways to find <code>SAGE_ROOT</code>:</p>
<ul>
<li><p>in a Sage session:</p>
<pre><code>sage: print(SAGE_ROOT)
</code></pre></li>
<li><p>in a shell session:</p>
<pre><code>$ sage -c 'print(SAGE_ROOT)'
</code></pre></li>
</ul>
<h3>Other tips for SageMath on macOS</h3>
<ul>
<li><p>Install JupyterLab</p>
<pre><code>sage: !pip install jupyterlab
</code></pre>
<p>You can then start Sage in JupyterLab</p></li>
<li><p>Install RISE</p>
<pre><code>sage: !pip install RISE
</code></pre>
<p>You can then turn Jupyter notebooks into presentations.</p>
<p>Currently works with Jupyter Notebook but not with JupyterLab.</p></li>
</ul>
https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52803#post-id-52803@Emmanuel Charpentier - Good point. So far taking every opportunity to share my private notes as answers to questions people ask. Hope some of that can become official documentation at some point.Sun, 02 Aug 2020 04:05:41 +0200https://ask.sagemath.org/question/52776/sagemath-on-macos-app-components-packages-sagetex/?comment=52803#post-id-52803