File: install.rst

package info (click to toggle)
sympy 1.7.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 37,052 kB
  • sloc: python: 426,614; xml: 359; sh: 318; makefile: 138; lisp: 4
file content (120 lines) | stat: -rw-r--r-- 3,890 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
.. _installation:

Installation
------------

The SymPy CAS can be installed on virtually any computer with Python.
SymPy does require `mpmath`_ Python library to be installed first.  The
recommended method of installation is through Anaconda, which includes
mpmath, as well as several other useful libraries.  Alternatively, some Linux
distributions have SymPy packages available.

SymPy officially supports Python 3.5, 3.6, 3.7, and PyPy.

Anaconda
========

`Anaconda <https://www.anaconda.com/download/>`_ is a free Python distribution from
Continuum Analytics that includes SymPy, Matplotlib, IPython, NumPy, and many
more useful packages for scientific computing. This is recommended because
many nice features of SymPy are only enabled when certain libraries are
installed.  For example, without Matplotlib, only simple text-based plotting
is enabled.  With the IPython notebook or qtconsole, you can get nicer
LaTeX printing by running ``init_printing()``.

If you already have Anaconda and want to update SymPy to the latest version,
use::

    conda update sympy

Git
===

If you wish to contribute to SymPy or like to get the latest updates as they
come, install SymPy from git. To download the repository, execute the
following from the command line::

    git clone https://github.com/sympy/sympy.git

To update to the latest version, go into your repository and execute::

    git pull origin master

If you want to install SymPy, but still want to use the git version, you can run
from your repository::

    python setupegg.py develop

This will cause the installed version to always point to the version in the git
directory.

Other Methods
=============

You may also install SymPy using pip or from source. In addition, most Linux
and Python distributions have some SymPy version available to install using
their package manager. Here is a list of several such Python distributions:

* `Anaconda <https://www.anaconda.com/download/>`_
* `Enthought Canopy <https://www.enthought.com/product/canopy/>`_
* `ActivePython <https://www.activestate.com/activepython>`_
* `Spack <https://spack.io/>`_

Run SymPy
=========

After installation, it is best to verify that your freshly-installed SymPy
works. To do this, start up Python and import the SymPy libraries::

    $ python
    >>> from sympy import *

From here, execute some simple SymPy statements like the ones below::

    >>> x = Symbol('x')
    >>> limit(sin(x)/x, x, 0)
    1
    >>> integrate(1/x, x)
    log(x)

For a starter guide on using SymPy effectively, refer to the :ref:`tutorial`.

Mpmath
======

Versions of SymPy prior to 1.0 included `mpmath`_, but it now depends on it as
an external dependency.  If you installed SymPy with Anaconda, it will already
include mpmath. Use::

  conda install mpmath

to ensure that it is installed.

If you do not wish to use Anaconda, you can use ``pip install mpmath``.

If you use mpmath via ``sympy.mpmath`` in your code, you will need to change
this to use just ``mpmath``. If you depend on code that does this that you
cannot easily change, you can work around it by doing::

    import sys
    import mpmath
    sys.modules['sympy.mpmath'] = mpmath

before the code that imports ``sympy.mpmath``. It is recommended to change
code that uses ``sympy.mpmath`` to use ``mpmath`` directly wherever possible.

Questions
=========

If you have a question about installation or SymPy in general, feel free to
visit our chat on `Gitter`_. In addition, our `mailing list`_ is an excellent
source of community support.

If you think there's a bug or you would like to request a feature, please open
an `issue ticket`_.

.. _downloads site: https://github.com/sympy/sympy/releases
.. _Gitter: https://gitter.im/sympy/sympy
.. _issue ticket: https://github.com/sympy/sympy/issues
.. _mailing list: https://groups.google.com/forum/#!forum/sympy
.. _mpmath: http://mpmath.org/