Starting Sage by launching sage
in the terminal
gives you a banner which includes the version of Sage.
$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.3.beta2, Release Date: 2018-05-18 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage:
You can also get just the version of Sage without starting
Sage, by running sage -v
or sage --version
in the terminal.
$ sage -v
SageMath version 8.3.beta2, Release Date: 2018-05-18
$ sage --version
SageMath version 8.3.beta2, Release Date: 2018-05-18
You can start Sage without getting the banner by running
sage -q
(q is for quiet) in the terminal.
$ sage -q
sage:
Combining those, you can get the version without the full banner,
by running sage -v; sage -q
in the terminal:
$ sage -v: sage -q
SageMath version 8.3.beta2, Release Date: 2018-05-18
Once Sage is started (illustrated below in the Sage REPL but would work
in the SageNB or Jupyter interface too), you can get its version number
by typing:
sage: version()
'SageMath version 8.3.beta2, Release Date: 2018-05-18'
For the installed Python packages (such as NumPy, SciPy, SymPy...),
you can usually get the version number as follows:
sage: import numpy
sage: print(numpy.__version__)
1.13.3
sage: import sympy
sage: print(sympy.__version__)
1.1.1
sage: import scipy
sage: print(scipy.__version__)
0.19.1
etc., but sometimes it is version
, or version_info
rather than __version__
.
sage: import tornado
sage: print(tornado.version)
4.5.2
sage: print(tornado.version_info)
(4, 5, 2, 0)
You could try typing the name of the module followed by .__ver
and hit
the TAB key, if that autocompletes to .__version__
then use that,
otherwise try typing the name of the module followed by .ver
and hit
the TAB key.
For other software shipped with Sage, which are not Python packages,
sometimes you get the version number as follows (again you could type
the software's name followed by .ver
and hit the TAB key to see the
autocompletion to .version
):
sage: print(maxima.version())
5.41.0
sage: print(r.version())
((3, 4, 4), 'R version 3.4.4 (2018-03-15)')
sage: print(gap.version())
4.8.6
sage: print(pari.version())
[2, 10, 0]
sage: print(gp.version())
((2, 10, 0), 'GP/PARI CALCULATOR Version 2.10.0 (development git-88fb5b3)')
The output for Singular is quite a bit longer...
sage: print(singular.version())
Singular for x86_64-Darwin version 4.1.0 (4103, 64 bit) May 22 2018 13:52:44 #UNKNOWN_GIT_VERSION
with
MPIR(3.0.0)~GMP(6.0.0),NTL(10.3.0),FLINT(2.5.2),factory(@(#) factoryVersion = 4.0.1),
static readline,Plural,DBM,
dynamic modules,dynamic p_Procs,OM_NDEBUG,SING_NDEBUG,CC:OPTIMIZE,eigenvalues,Gauss-Manin system,random=215477597
built-in modules: {}
AC_CONFIGURE_ARGS = '--prefix=/opt/s/s83b2py2/local' '--libdir=/opt/s/s83b2py2/local/lib' '--exec-prefix=/opt/s/s83b2py2/local' '--bindir=/opt/s/s83b2py2/local/bin' '--with-gmp=/opt/s/s83b2py2/local' '--with-ntl=/opt/s/s83b2py2/local' '--with-flint=/opt/s/s83b2py2/local' '--enable-gfanlib' '--enable-Singular' '--enable-factory' '--disable-doc' '--disable-polymake' 'CC=gcc' 'CFLAGS=-O2 -g ' 'LDFLAGS=-L/opt/s/s83b2py2/local/lib -Wl,-rpath,/opt/s/s83b2py2/local/lib ' 'CXX=g++' 'CXXFLAGS=-O2 -g ' --enable-omalloc OMALLOC_LIBS='/opt/s/s83b2py2/local/var/tmp/sage/build/singular-4.1.0p3.p2/src/omalloc/libomalloc.la' OMALLOC_INCLUDES='-I/opt/s/s83b2py2/local/var/tmp/sage/build/singular-4.1.0p3.p2/src' --with-Singular RESOURCES_LIBS='/opt/s/s83b2py2/local/var/tmp/sage/build/singular-4.1.0p3.p2/src/resources/libsingular_resources.la' RESOURCES_INCLUDES='-I/opt/s/s83b2py2/local/var/tmp/sage/build/singular-4.1.0p3.p2/src ' FACTORY_LIBS='/opt/s/s83b2py2/local/var/tmp/sage/build/singular-4.1.0p3.p2/src/factory/libfactory.la' FACTORY_INCLUDES='-I/opt/s/s83b2py2/local/var/tmp/sage/build/singular-4.1.0p3.p2/src -I/opt/s/s83b2py2/local/var/tmp/sage/build/singular-4.1.0p3.p2/src/factory/include',
CC = gcc,FLAGS : -O2 -g -pipe -fno-common -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -fno-exceptions -fno-rtti -fno-threadsafe-statics -funroll-loops -Qunused-arguments -pthread,
CXX = g++,FLAGS : -O2 -g -pipe -fno-common -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -fno-exceptions -fno-rtti -fno-threadsafe-statics -funroll-loops -Qunused-arguments,
DEFS : ,CPPFLAGS : ,
LDFLAGS : -L/opt/s/s83b2py2/local/lib -Wl,-rpath,/opt/s/s83b2py2/local/lib -pipe -fno-common -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -fno-exceptions -fno-rtti -fno-threadsafe-statics -funroll-loops -Qunused-arguments -rdynamic -flat_namespace -Wl,-bind_at_load -Wl,-undefined,dynamic_lookup,LIBS : -lreadline -lncurses (ver: 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81))
argv[0] : /opt/s/s83b2py2/local/bin/Singular
SearchPath: /opt/s/s83b2py2/local/share/singular:/opt/s/s83b2py2/local/bin/../share/singular/LIB:/opt/s/s83b2py2/local/bin/../share/factory:/opt/s/s83b2py2/local/bin/../libexec/singular/MOD:/opt/s/s83b2py2/local/libexec/singular/MOD:/opt/s/s83b2py2/local/bin
Singular : /opt/s/s83b2py2/local/bin/Singular
BinDir : /opt/s/s83b2py2/local/bin
ProcDir : /opt/s/s83b2py2/local/bin/../libexec/singular/MOD:/opt/s/s83b2py2/local/libexec/singular/MOD
RootDir : /opt/s/s83b2py2/local/bin/..
DataDir : /opt/s/s83b2py2/local/bin/../share
DefaultDir: /opt/s/s83b2py2/local
InfoFile : /opt/s/s83b2py2/local/bin/../share/info/singular.hlp
IdxFile : /opt/s/s83b2py2/local/bin/../share/singular/singular.idx
HtmlDir : /opt/s/s83b2py2/local/bin/../share/singular/html
ManualUrl : http://www.singular.uni-kl.de/Manual/
ExDir :
Path : /opt/s/s83b2py2/local/bin:/opt/s/s83b2py2/local/bin/../libexec/singular/MOD:/opt/s/s83b2py2/local/libexec/singular/MOD:/opt/s/s83b2py2/local/libexec/ccache:/opt/s/s83b2py2/build/bin:/opt/s/s83b2py2/src/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/texbin
emacs : /usr/local/bin/../Cellar/emacs/25.3/bin/emacs-25.3
xemacs :
SingularEmacs: /opt/s/s83b2py2/local/bin/Singular
EmacsLoad : /opt/s/s83b2py2/local/bin/../share/singular/emacs/.emacs-singular
EmacsDir : /opt/s/s83b2py2/local/bin/../share/singular/emacs
SingularXterm: /opt/s/s83b2py2/local/bin/Singular
xterm :
EmacsDir : /opt/s/s83b2py2/local/bin/../share/singular/emacs
Available HelpBrowsers: mac, mac-net, safari, info, lynx, mac-www, safari-www-idx, safari-www, lynx-www-idx, lynx-www, builtin, dummy, emacs,
Current HelpBrowser: mac
Another way to get to the version number information, especially if
you built Sage from source, is to use the terminal, and change directory
to the upstream
subdirectory of the Sage installation directory.
For instance, if the Sage installation directory is /home/user/SageMath
,
then do this in a terminal:
$ cd /home/user/SageMath/upstream
$ ls
and you will see the tarballs for many of the included software and Python
packages, which include the version numbers. In my case:
$ cd /home/user/SageMath/upstream
$ ls
Babel-2.5.1.tar.gz
Cython-0.28.1.tar.gz
Flask-0.10.1.tar.gz
Flask_AutoIndex-0.6.tar.gz
Flask_Babel-0.9.tar.gz
Flask_OldSessions-0.10.tar.gz
Flask_OpenID-1.2.5.tar.gz
Flask_Silk-0.2.tar.gz
OpenBLAS-0.2.20.tar.gz
Pillow-4.3.0.tar.gz
PyCygwin-0.1.tar.gz
Pygments-2.2.0.tar.gz
Python-2.7.15.tar.xz
Python-3.6.1.tar.gz
R-3.4.4.tar.gz
Send2Trash-1.4.2.tar.gz
Sphinx-1.6.3.tar.gz
Twisted-16.3.0.tar.bz2
Werkzeug-0.11.10.tar.gz
alabaster-0.7.10.tar.gz
appnope-0.1.0.tar.gz
arb-2.12.0.tar.gz
backports.functools_lru_cache-1.4.tar.gz
backports.shutil_get_terminal_size-1.0.0.tar.gz
backports_abc-0.5.tar.gz
backports_ssl_match_hostname-3.5.0.1.tar.gz
bleach-2.1.3.tar.gz
boost_cropped-1.58.0.tar.bz2
brial-1.0.1.tar.bz2
bzip2-1.0.6-20150304.tar.gz
ccache-3.3.4.tar.bz2
cddlib-094i.tar.gz
cephes-2.8.tar.bz2
certifi-2017.11.5.tar.gz
cliquer-1.21.tar.gz
combinatorial_designs-20140630.tar.bz2
configparser-3.5.0.tar.gz
conway_polynomials-0.5.tar.bz2
cvxopt-1.1.8.tar.gz
cycler-0.10.0.tar.gz
cypari2-1.1.4.tar.gz
cysignals-1.7.1.tar.gz
decorator-4.0.6.tar.gz
docutils-0.14.tar.gz
ecl-16.1.2.tar.bz2
eclib-20171002.tar.bz2
ecm-7.0.4.tar.gz
elliptic_curves-0.8.tar.bz2
entrypoints-0.2.3.tar.gz
enum34-1.1.6.tar.gz
fflas_ffpack-2.3.2.tar.bz2
flint-2.5.2.tar.gz
flintqs-1.0.tar.bz2
fplll-5.2.0.tar.gz
fpylll-0.3.0dev.tar.gz
freetype-2.8.1.tar.bz2
functools32-3.2.3-2.tar.gz
future-0.16.0.tar.gz
gap-4.8.6.tar.bz2
gc-7.6.4.tar.gz
gcc-7.2.0.tar.xz
gf2x-1.2.tar.gz
gfan0.6.2.tar.gz
giac-1.4.9.45.tar.bz2
givaro-4.0.4.tar.gz
glpk-4.63.tar.bz2
graphs-20161026.tar.bz2
gsl-2.3.tar.gz
html5lib-1.0.1.tar.gz
imagesize-0.7.1.tar.gz
iml-1.0.4p1.tar.bz2
ipykernel-4.7.0.tar.gz
ipython-5.5.0.tar.gz
ipython_genutils-0.2.0.tar.gz
ipywidgets-7.2.0.tar.gz
itsdangerous-0.24.tar.gz
jinja2-2.10.tar.gz
jmol-14.6.1_2016.07.11.tar.bz2
jsonschema-2.6.0.tar.gz
jupyter_client-5.2.2.tar.gz
jupyter_core-4.4.0.tar.gz
lcalc-1.23.tar.bz2
libatomic_ops-7.6.2.tar.gz
libgap-4.8.6.tar.gz
libgd-2.1.1.1.tar.bz2
libiconv-1.15.tar.gz
libpng-1.6.29.tar.gz
linbox-1.5.2.tar.gz
lrcalc-1.2.tar.gz
m4ri-20140914.tar.gz
m4rie-20150908.tar.gz
markupsafe-1.0.tar.gz
mathjax-2.7.4.tar.gz
matplotlib-2.1.0.tar.bz2
maxima-5.41.0.tar.gz
mistune-0.8.3.tar.gz
mpc-1.1.0.tar.gz
mpfi-1.5.2.tar.bz2
mpfr-4.0.1.tar.bz2
mpir-3.0.0-644faf502c56f97d9accd301965fc57d6ec70868.tar.bz2
mpmath-1.0.0.tar.gz
nauty-26r1.tar.gz
nbconvert-5.3.1.tar.gz
nbformat-4.4.0.tar.gz
ncurses-6.0.tar.gz
networkx-1.11.tar.gz
notebook-5.3.1.tar.gz
ntl-10.3.0.tar.gz
numpy-1.13.3.zip
palp-2.1.tar.bz2
pandocfilters-1.4.2.tar.gz
pari-2.10-1280-g88fb5b3.tar.gz
pari_galdata-20080411.tar.bz2
pari_seadata_small-20090618.tar.bz2
patch-2.7.5.tar.gz
pathlib2-2.3.0.tar.gz
pathpy-7.1.tar.bz2
pcre-8.40.tar.gz
pexpect-4.1.0.tar.gz
pickleshare-0.7.4.tar.gz
pip-9.0.3.tar.gz
pkgconf-0.9.7.tar.gz
pkgconfig-1.2.2.tar.gz
planarity-3.0.0.5.tar.gz
polytopes_db-20170220.tar.bz2
ppl-1.2.tar.bz2
prompt_toolkit-1.0.15.tar.gz
psutil-5.2.0.tar.gz
ptyprocess-0.5.1.tar.gz
pycrypto-2.6.1.tar.gz
pynac-0.7.16.tar.bz2
pyparsing-2.2.0.tar.gz
python-dateutil-2.5.3.tar.gz
python_openid-2.2.5.tar.gz
pytz-2017.3.tar.bz2
pyzmq-17.0.0b3.tar.gz
ratpoints-2.1.3.tar.bz2
readline-6.3.008.tar.gz
requests-2.13.0.tar.gz
rpy2-2.8.2.tar.gz
rubiks-20070912.tar.bz2
rw-0.7.tar.gz
sagenb-1.0.1.tar.bz2
sagenb_export-3.2.tar.gz
sagetex-3.0.tar.gz
scandir-1.6.tar.gz
scipy-0.19.1.tar.gz
setuptools-38.2.4.zip
setuptools_scm-1.15.6.tar.gz
simplegeneric-0.8.1.tar.bz2
singledispatch-3.4.0.3.tar.gz
singular-4.1.0p3.tar.gz
six-1.11.0.tar.gz
snowballstemmer-1.2.1.tar.gz
speaklater-1.3.tar.gz
sphinxcontrib-websupport-1.0.1.tar.gz
sqlite-autoconf-3220000.tar.gz
subprocess32-3.2.7.tar.gz
symmetrica-2.0.tar.bz2
sympow-1.018.1.tar.bz2
sympy-1.1.1.tar.gz
tachyon-0.98.9.tar.bz2
terminado-0.8.1.tar.gz
testpath-0.3.1.tar.gz
thebe-9624e0a0.zip
threejs-r80.tar.gz
tornado-4.5.2.tar.gz
traitlets-4.3.2.tar.gz
typing-3.6.2.tar.gz
vcversioner-2.16.0.0.tar.gz
wcwidth-0.1.7.tar.gz
webencodings-0.5.1.tar.gz
widgetsnbextension-3.2.0.tar.gz
xz-5.2.2.tar.gz
yasm-1.3.0.tar.gz
zeromq-4.0.5.tar.gz
zlib-1.2.11.tar.gz
zn_poly-0.9.tar.bz2
zope.interface-4.4.3.tar.gz
Note: a similar question was asked on 2014-07-02 as