-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.html
241 lines (231 loc) · 14.5 KB
/
install.html
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Installation — SymPy 1.8 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
<link rel="stylesheet" type="text/css" href="https://live.sympy.org/static/live-core.css" />
<link rel="stylesheet" type="text/css" href="https://live.sympy.org/static/live-autocomplete.css" />
<link rel="stylesheet" type="text/css" href="https://live.sympy.org/static/live-sphinx.css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script src="https://live.sympy.org/static/utilities.js"></script>
<script src="https://live.sympy.org/static/external/classy.js"></script>
<script src="https://live.sympy.org/static/live-core.js"></script>
<script src="https://live.sympy.org/static/live-autocomplete.js"></script>
<script src="https://live.sympy.org/static/live-sphinx.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS_HTML-full"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
<link rel="shortcut icon" href="_static/sympy-notailtext-favicon.ico"/>
<link href="https://docs.sympy.org/latest/install.html" rel="canonical" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="SymPy Tutorial" href="tutorial/index.html" />
<link rel="prev" title="Welcome to SymPy’s documentation!" href="index.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="tutorial/index.html" title="SymPy Tutorial"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to SymPy’s documentation!"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">SymPy 1.8 documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">Installation</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="installation">
<span id="id1"></span><h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1>
<p>The SymPy CAS can be installed on virtually any computer with Python.
SymPy does require <a class="reference external" href="http://mpmath.org/">mpmath</a> 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.</p>
<p>SymPy officially supports Python 3.5, 3.6, 3.7, and PyPy.</p>
<div class="section" id="anaconda">
<h2>Anaconda<a class="headerlink" href="#anaconda" title="Permalink to this headline">¶</a></h2>
<p><a class="reference external" href="https://www.anaconda.com/download/">Anaconda</a> 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
<span class="math notranslate nohighlight">\(\mathrm{\LaTeX}\)</span> printing by running <code class="docutils literal notranslate"><span class="pre">init_printing()</span></code>.</p>
<p>If you already have Anaconda and want to update SymPy to the latest version,
use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">update</span> <span class="n">sympy</span>
</pre></div>
</div>
</div>
<div class="section" id="git">
<h2>Git<a class="headerlink" href="#git" title="Permalink to this headline">¶</a></h2>
<p>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:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">clone</span> <span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">github</span><span class="o">.</span><span class="n">com</span><span class="o">/</span><span class="n">sympy</span><span class="o">/</span><span class="n">sympy</span><span class="o">.</span><span class="n">git</span>
</pre></div>
</div>
<p>To update to the latest version, go into your repository and execute:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">git</span> <span class="n">pull</span> <span class="n">origin</span> <span class="n">master</span>
</pre></div>
</div>
<p>If you want to install SymPy, but still want to use the git version, you can run
from your repository:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="n">setupegg</span><span class="o">.</span><span class="n">py</span> <span class="n">develop</span>
</pre></div>
</div>
<p>This will cause the installed version to always point to the version in the git
directory.</p>
</div>
<div class="section" id="other-methods">
<h2>Other Methods<a class="headerlink" href="#other-methods" title="Permalink to this headline">¶</a></h2>
<p>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:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://www.anaconda.com/download/">Anaconda</a></p></li>
<li><p><a class="reference external" href="https://www.enthought.com/product/canopy/">Enthought Canopy</a></p></li>
<li><p><a class="reference external" href="https://www.activestate.com/activepython">ActivePython</a></p></li>
<li><p><a class="reference external" href="https://spack.io/">Spack</a></p></li>
</ul>
</div>
<div class="section" id="run-sympy">
<h2>Run SymPy<a class="headerlink" href="#run-sympy" title="Permalink to this headline">¶</a></h2>
<p>After installation, it is best to verify that your freshly-installed SymPy
works. To do this, start up Python and import the SymPy libraries:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ python
>>> from sympy import *
</pre></div>
</div>
<p>From here, execute some simple SymPy statements like the ones below:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">'x'</span><span class="p">)</span>
<span class="gp">>>> </span><span class="n">limit</span><span class="p">(</span><span class="n">sin</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">/</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">>>> </span><span class="n">integrate</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">log(x)</span>
</pre></div>
</div>
<p>For a starter guide on using SymPy effectively, refer to the <a class="reference internal" href="tutorial/index.html#tutorial"><span class="std std-ref">SymPy Tutorial</span></a>.</p>
</div>
<div class="section" id="mpmath">
<h2>Mpmath<a class="headerlink" href="#mpmath" title="Permalink to this headline">¶</a></h2>
<p>Versions of SymPy prior to 1.0 included <a class="reference external" href="http://mpmath.org/">mpmath</a>, but it now depends on it as
an external dependency. If you installed SymPy with Anaconda, it will already
include mpmath. Use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">install</span> <span class="n">mpmath</span>
</pre></div>
</div>
<p>to ensure that it is installed.</p>
<p>If you do not wish to use Anaconda, you can use <code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">mpmath</span></code>.</p>
<p>If you use mpmath via <code class="docutils literal notranslate"><span class="pre">sympy.mpmath</span></code> in your code, you will need to change
this to use just <code class="docutils literal notranslate"><span class="pre">mpmath</span></code>. If you depend on code that does this that you
cannot easily change, you can work around it by doing:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">mpmath</span>
<span class="n">sys</span><span class="o">.</span><span class="n">modules</span><span class="p">[</span><span class="s1">'sympy.mpmath'</span><span class="p">]</span> <span class="o">=</span> <span class="n">mpmath</span>
</pre></div>
</div>
<p>before the code that imports <code class="docutils literal notranslate"><span class="pre">sympy.mpmath</span></code>. It is recommended to change
code that uses <code class="docutils literal notranslate"><span class="pre">sympy.mpmath</span></code> to use <code class="docutils literal notranslate"><span class="pre">mpmath</span></code> directly wherever possible.</p>
</div>
<div class="section" id="questions">
<h2>Questions<a class="headerlink" href="#questions" title="Permalink to this headline">¶</a></h2>
<p>If you have a question about installation or SymPy in general, feel free to
visit our chat on <a class="reference external" href="https://gitter.im/sympy/sympy">Gitter</a>. In addition, our <a class="reference external" href="https://groups.google.com/forum/#!forum/sympy">mailing list</a> is an excellent
source of community support.</p>
<p>If you think there’s a bug or you would like to request a feature, please open
an <a class="reference external" href="https://github.com/sympy/sympy/issues">issue ticket</a>.</p>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/sympylogo.png" alt="Logo"/>
</a></p>
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Installation</a><ul>
<li><a class="reference internal" href="#anaconda">Anaconda</a></li>
<li><a class="reference internal" href="#git">Git</a></li>
<li><a class="reference internal" href="#other-methods">Other Methods</a></li>
<li><a class="reference internal" href="#run-sympy">Run SymPy</a></li>
<li><a class="reference internal" href="#mpmath">Mpmath</a></li>
<li><a class="reference internal" href="#questions">Questions</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">Welcome to SymPy’s documentation!</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="tutorial/index.html"
title="next chapter">SymPy Tutorial</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/install.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="tutorial/index.html" title="SymPy Tutorial"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to SymPy’s documentation!"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">SymPy 1.8 documentation</a> »</li>
<li class="nav-item nav-item-this"><a href="">Installation</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2021 SymPy Development Team.
Last updated on Apr 09, 2021.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.3.1.
</div>
</body>
</html>