mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-15 11:22:18 +08:00
DOC: improved doc of matplotlib error after installation
This commit is contained in:
+21
-7
@@ -408,20 +408,34 @@ following brew packages:
|
||||
|
||||
$ brew install freetype pkg-config gcc openssl
|
||||
|
||||
MacOS + virtualenv + matplotlib
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
MacOS + virtualenv/conda + matplotlib
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
A note about using matplotlib in virtual enviroments on MacOS: it may be
|
||||
necessary to run
|
||||
The first time that you try to run an algorithm that loads the ``matplotlib``
|
||||
library, you may get the following error:
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
RuntimeError: Python is not installed as a framework. The Mac OS X backend
|
||||
will not be able to function correctly if Python is not installed as a
|
||||
framework. See the Python documentation for more information on installing
|
||||
Python as a framework on Mac OS X. Please either reinstall Python as a
|
||||
framework, or try one of the other backends. If you are using (Ana)Conda
|
||||
please install python.app and replace the use of 'python' with 'pythonw'.
|
||||
See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more
|
||||
information.
|
||||
|
||||
This is a ``matplotlib``-specific error, that will go away once you run the
|
||||
following command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
echo "backend: TkAgg" > ~/.matplotlib/matplotlibrc
|
||||
|
||||
in order to override the default ``MacOS`` backend for your system, which
|
||||
may not be accessible from inside the virtual environment. This will allow
|
||||
Catalyst to open matplotlib charts from within a virtual environment, which
|
||||
is useful for displaying the performance of your backtests. To learn more
|
||||
may not be accessible from inside the virtual or conda environment. This will
|
||||
allow Catalyst to open matplotlib charts from within a virtual environment,
|
||||
which is useful for displaying the performance of your backtests. To learn more
|
||||
about matplotlib backends, please refer to the
|
||||
`matplotlib backend documentation <https://matplotlib.org/faq/usage_faq.html#what-is-a-backend>`_.
|
||||
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
+20
-8
@@ -87,7 +87,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="#windows-requirements">Windows Requirements</a></li>
|
||||
@@ -592,17 +592,29 @@ following brew packages:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>brew install freetype pkg-config gcc openssl
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="section" id="macos-virtualenv-matplotlib">
|
||||
<h3>MacOS + virtualenv + matplotlib<a class="headerlink" href="#macos-virtualenv-matplotlib" title="Permalink to this headline">¶</a></h3>
|
||||
<p>A note about using matplotlib in virtual enviroments on MacOS: it may be
|
||||
necessary to run</p>
|
||||
<div class="section" id="macos-virtualenv-conda-matplotlib">
|
||||
<h3>MacOS + virtualenv/conda + matplotlib<a class="headerlink" href="#macos-virtualenv-conda-matplotlib" title="Permalink to this headline">¶</a></h3>
|
||||
<p>The first time that you try to run an algorithm that loads the <code class="docutils literal"><span class="pre">matplotlib</span></code>
|
||||
library, you may get the following error:</p>
|
||||
<div class="highlight-text"><div class="highlight"><pre>RuntimeError: Python is not installed as a framework. The Mac OS X backend
|
||||
will not be able to function correctly if Python is not installed as a
|
||||
framework. See the Python documentation for more information on installing
|
||||
Python as a framework on Mac OS X. Please either reinstall Python as a
|
||||
framework, or try one of the other backends. If you are using (Ana)Conda
|
||||
please install python.app and replace the use of 'python' with 'pythonw'.
|
||||
See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more
|
||||
information.
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>This is a <code class="docutils literal"><span class="pre">matplotlib</span></code>-specific error, that will go away once you run the
|
||||
following command:</p>
|
||||
<div class="highlight-bash"><div class="highlight"><pre><span class="nb">echo</span> <span class="s2">"backend: TkAgg"</span> > ~/.matplotlib/matplotlibrc
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>in order to override the default <code class="docutils literal"><span class="pre">MacOS</span></code> backend for your system, which
|
||||
may not be accessible from inside the virtual environment. This will allow
|
||||
Catalyst to open matplotlib charts from within a virtual environment, which
|
||||
is useful for displaying the performance of your backtests. To learn more
|
||||
may not be accessible from inside the virtual or conda environment. This will
|
||||
allow Catalyst to open matplotlib charts from within a virtual environment,
|
||||
which is useful for displaying the performance of your backtests. To learn more
|
||||
about matplotlib backends, please refer to the
|
||||
<a class="reference external" href="https://matplotlib.org/faq/usage_faq.html#what-is-a-backend">matplotlib backend documentation</a>.</p>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -87,7 +87,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-matplotlib">MacOS + virtualenv + matplotlib</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
|
||||
|
||||
Reference in New Issue
Block a user