mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-27 17:47:56 +08:00
738 lines
40 KiB
HTML
738 lines
40 KiB
HTML
|
||
|
||
<!DOCTYPE html>
|
||
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
|
||
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
|
||
<head>
|
||
<meta charset="utf-8">
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
||
<title>Install — Catalyst 0.4 documentation</title>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
|
||
|
||
|
||
|
||
|
||
|
||
<link rel="index" title="Index"
|
||
href="genindex.html"/>
|
||
<link rel="search" title="Search" href="search.html"/>
|
||
<link rel="top" title="Catalyst 0.4 documentation" href="index.html"/>
|
||
<link rel="next" title="Catalyst Beginner Tutorial" href="beginner-tutorial.html"/>
|
||
<link rel="prev" title="Overview" href="index.html"/>
|
||
|
||
|
||
<script src="_static/js/modernizr.min.js"></script>
|
||
|
||
</head>
|
||
|
||
<body class="wy-body-for-nav" role="document">
|
||
|
||
|
||
<div class="wy-grid-for-nav">
|
||
|
||
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||
<div class="wy-side-scroll">
|
||
<div class="wy-side-nav-search">
|
||
|
||
|
||
|
||
<a href="index.html" class="icon icon-home"> Catalyst
|
||
|
||
|
||
|
||
</a>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div role="search">
|
||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
||
<input type="text" name="q" placeholder="Search docs" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
|
||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<ul class="current">
|
||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Install</a><ul>
|
||
<li class="toctree-l2"><a class="reference internal" href="#installing-with-conda">Installing with <code class="docutils literal"><span class="pre">conda</span></code></a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#troubleshooting-conda-install">Troubleshooting <code class="docutils literal"><span class="pre">conda</span></code> Install</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#installing-with-pip">Installing with <code class="docutils literal"><span class="pre">pip</span></code></a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#troubleshooting-pip-install">Troubleshooting <code class="docutils literal"><span class="pre">pip</span></code> Install</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#installing-with-pipenv">Installing with <code class="docutils literal"><span class="pre">pipenv</span></code></a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#gnu-linux-requirements">GNU/Linux Requirements</a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#amazon-linux-ami-notes">Amazon Linux AMI Notes</a></li>
|
||
</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-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>
|
||
<li class="toctree-l2"><a class="reference internal" href="#updating-catalyst">Updating Catalyst</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#getting-help">Getting Help</a></li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="beginner-tutorial.html">Catalyst Beginner Tutorial</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="live-trading.html">Live Trading</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="features.html">Features</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="example-algos.html">Example Algorithms</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="utilities.html">Utilities</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="videos.html">Videos</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="resources.html">Resources</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="development-guidelines.html">Development Guidelines</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="releases.html">Release Notes</a></li>
|
||
</ul>
|
||
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
|
||
|
||
|
||
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
|
||
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
<a href="index.html">Catalyst</a>
|
||
|
||
</nav>
|
||
|
||
|
||
|
||
<div class="wy-nav-content">
|
||
<div class="rst-content">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<div role="navigation" aria-label="breadcrumbs navigation">
|
||
|
||
<ul class="wy-breadcrumbs">
|
||
|
||
<li><a href="index.html">Docs</a> »</li>
|
||
|
||
<li>Install</li>
|
||
|
||
|
||
<li class="wy-breadcrumbs-aside">
|
||
|
||
|
||
<a href="_sources/install.rst.txt" rel="nofollow"> View page source</a>
|
||
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
|
||
<hr/>
|
||
</div>
|
||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||
<div itemprop="articleBody">
|
||
|
||
<div class="section" id="install">
|
||
<h1>Install<a class="headerlink" href="#install" title="Permalink to this headline">¶</a></h1>
|
||
<p>To get started with Catalyst, you will need to install it in your computer.
|
||
Like any other piece of software, Catalyst has a number of dependencies
|
||
(other software on which it depends to run) that you will need to install, as
|
||
well. We recommend using a software named <code class="docutils literal"><span class="pre">Conda</span></code> that will manage all
|
||
these dependencies for you, and set up the environment needed to get you up
|
||
and running as easily as possible. This is the recommended installation method
|
||
for Windows, MacOS and Linux. See <a class="reference internal" href="#conda"><span class="std std-ref">Installing with Conda</span></a>.</p>
|
||
<p>What conda does is create a pre-configured environment, and inside that
|
||
environment install Catalyst using <code class="docutils literal"><span class="pre">pip</span></code>, Python’s package manager. Thus,
|
||
as an alternative installation method for MacOS and Linux, you can install
|
||
Catalyst directly with <code class="docutils literal"><span class="pre">pip</span></code> (we recommend in combination with a virtual
|
||
environemnt). See <a class="reference internal" href="#pip"><span class="std std-ref">Installing with pip</span></a>.</p>
|
||
<p>Alternatively you can install Catalyst using <code class="docutils literal"><span class="pre">pipenv</span></code> which is a mix of pip
|
||
and virtualenv. See <a class="reference internal" href="#pipenv"><span class="std std-ref">Installing with pipenv</span></a>.</p>
|
||
<p>Regardless of the method, each operating system (OS), has its own
|
||
prerequisites, make sure to review the corresponding sections for your system:
|
||
<a class="reference internal" href="#linux"><span class="std std-ref">Linux</span></a>, <a class="reference internal" href="#macos"><span class="std std-ref">MacOS</span></a> and <a class="reference internal" href="#windows"><span class="std std-ref">Windows</span></a>.</p>
|
||
<div class="section" id="installing-with-conda">
|
||
<span id="conda"></span><h2>Installing with <code class="docutils literal"><span class="pre">conda</span></code><a class="headerlink" href="#installing-with-conda" title="Permalink to this headline">¶</a></h2>
|
||
<p>The preferred method to install Catalyst is via the <code class="docutils literal"><span class="pre">conda</span></code> package manager,
|
||
which comes as part of Continuum Analytics’ <a class="reference external" href="http://continuum.io/downloads">Anaconda</a> distribution.</p>
|
||
<p>The primary advantage of using Conda over <code class="docutils literal"><span class="pre">pip</span></code> is that conda natively
|
||
understands the complex binary dependencies of packages like <code class="docutils literal"><span class="pre">numpy</span></code> and
|
||
<code class="docutils literal"><span class="pre">scipy</span></code>. This means that <code class="docutils literal"><span class="pre">conda</span></code> can install Catalyst and its
|
||
dependencies without requiring the use of a second tool to acquire Catalyst’s
|
||
non-Python dependencies.</p>
|
||
<blockquote>
|
||
<div>For Windows, you will first need to install the <em>Microsoft Visual C++
|
||
Compiler for Python 2.7</em>. Follow the instructions on the <a class="reference internal" href="#windows"><span class="std std-ref">Windows</span></a> section and come back here.</div></blockquote>
|
||
<p>For instructions on how to install <code class="docutils literal"><span class="pre">conda</span></code>, see the <a class="reference external" href="http://conda.pydata.org/docs/download.html">Conda Installation
|
||
Documentation</a>. Alternatively,
|
||
you can install MiniConda, which is a smaller footprint (fewer packages and
|
||
smaller size) than its big brother Anaconda, but it still contains all the
|
||
main packages needed. To install MiniConda, you can follow these steps:</p>
|
||
<ol class="arabic simple">
|
||
<li>Download <a class="reference external" href="https://conda.io/miniconda.html">MiniConda</a>. Select either
|
||
Python 3.6 (recommended) or Python 2.7 for your Operating System. The
|
||
<a class="reference external" href="https://enigmampc.github.io/marketplace/">Enigma Data Marketplace</a> will
|
||
require Python3, that’s why we are recommending to opt for the newer version.</li>
|
||
<li>Install MiniConda. See the <a class="reference external" href="https://conda.io/docs/user-guide/install/index.html">Installation Instructions</a> if you need help.</li>
|
||
<li>Ensure the correct installation by running <code class="docutils literal"><span class="pre">conda</span> <span class="pre">list</span></code> in a Terminal
|
||
window, which should print the list of packages installed with Conda.</li>
|
||
</ol>
|
||
<blockquote>
|
||
<div>For Windows, if you accepted the default installation options, you didn’t
|
||
check an option to add Conda to the PATH, so trying to run <code class="docutils literal"><span class="pre">conda</span></code> from
|
||
a regular <code class="docutils literal"><span class="pre">Command</span> <span class="pre">Prompt</span></code> will result in the following error: <code class="docutils literal"><span class="pre">'conda'</span>
|
||
<span class="pre">is</span> <span class="pre">no</span> <span class="pre">recognized</span> <span class="pre">as</span> <span class="pre">an</span> <span class="pre">internal</span> <span class="pre">or</span> <span class="pre">external</span> <span class="pre">command,</span> <span class="pre">operatble</span> <span class="pre">program</span> <span class="pre">or</span>
|
||
<span class="pre">batch</span> <span class="pre">file</span></code>. That’s to be expected. You will nee to launch an <code class="docutils literal"><span class="pre">Anaconda</span>
|
||
<span class="pre">Prompt</span></code> that was added at installation time to your list of programs
|
||
available from the Start menu.</div></blockquote>
|
||
<p>Once either Conda or MiniConda has been set up you can install Catalyst:</p>
|
||
<ol class="arabic">
|
||
<li><p class="first">Download the file <a class="reference external" href="https://github.com/enigmampc/catalyst/blob/master/etc/python3.6-environment.yml">python3.6-environment.yml</a>
|
||
(recommended) or <a class="reference external" href="https://github.com/enigmampc/catalyst/blob/master/etc/python2.7-environment.yml">python2.7-environment.yml</a>
|
||
matching your Conda installation from step #1 above.</p>
|
||
<blockquote>
|
||
<div><p>To download, simply click on the ‘Raw’ button and save the file locally
|
||
to a folder you can remember. Make sure that the file gets saved with the
|
||
<code class="docutils literal"><span class="pre">.yml</span></code> extension, and nothing like a <code class="docutils literal"><span class="pre">.txt</span></code> file or anything else.</p>
|
||
</div></blockquote>
|
||
</li>
|
||
<li><p class="first">Open a Terminal window and enter [<code class="docutils literal"><span class="pre">cd/dir</span></code>] into the directory where you
|
||
saved the above <code class="docutils literal"><span class="pre">.yml</span></code> file.</p>
|
||
</li>
|
||
<li><p class="first">Install using this file. This step can take about 5-10 minutes to install.</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>conda env create -f python3.6-environment.yml
|
||
</pre></div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
<blockquote>
|
||
<div><p>or</p>
|
||
<blockquote>
|
||
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>conda env create -f python2.7-environment.yml
|
||
</pre></div>
|
||
</div>
|
||
</div></blockquote>
|
||
</div></blockquote>
|
||
<ol class="arabic" start="4">
|
||
<li><p class="first">Activate the environment (which you need to do every time you start a new
|
||
session to run Catalyst):</p>
|
||
<p><strong>Linux or MacOS:</strong></p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">source</span> activate catalyst
|
||
</pre></div>
|
||
</div>
|
||
<p><strong>Windows:</strong></p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>activate catalyst
|
||
</pre></div>
|
||
</div>
|
||
</li>
|
||
<li><p class="first">Verify that Catalyst is install correctly:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>catalyst --version
|
||
</pre></div>
|
||
</div>
|
||
<p>which should display the current version.</p>
|
||
</li>
|
||
</ol>
|
||
<p>Congratulations! You now have Catalyst installed.</p>
|
||
<div class="section" id="troubleshooting-conda-install">
|
||
<h3>Troubleshooting <code class="docutils literal"><span class="pre">conda</span></code> Install<a class="headerlink" href="#troubleshooting-conda-install" title="Permalink to this headline">¶</a></h3>
|
||
<p>If the command <code class="docutils literal"><span class="pre">conda</span> <span class="pre">env</span> <span class="pre">create</span> <span class="pre">-f</span> <span class="pre">python2.7-environment.yml</span></code> in step 3
|
||
above failed for any reason, you can try setting up the environment manually
|
||
with the following steps:</p>
|
||
<ol class="arabic">
|
||
<li><p class="first">If the above installation failed, and you have a partially set up catalyst
|
||
environment, remove it first. If you are starting from scratch, proceed to
|
||
step #2:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>conda env remove --name catalyst
|
||
</pre></div>
|
||
</div>
|
||
</li>
|
||
<li><p class="first">Create the environment:</p>
|
||
<p>for python 2.7:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>conda create --name catalyst <span class="nv">python</span><span class="o">=</span><span class="m">2</span>.7 scipy zlib
|
||
</pre></div>
|
||
</div>
|
||
</li>
|
||
</ol>
|
||
<blockquote>
|
||
<div><p>or for python 3.6:</p>
|
||
<blockquote>
|
||
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>conda create --name catalyst <span class="nv">python</span><span class="o">=</span><span class="m">3</span>.6 scipy zlib
|
||
</pre></div>
|
||
</div>
|
||
</div></blockquote>
|
||
</div></blockquote>
|
||
<ol class="arabic" start="3">
|
||
<li><p class="first">Activate the environment:</p>
|
||
<p><strong>Linux or MacOS:</strong></p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">source</span> activate catalyst
|
||
</pre></div>
|
||
</div>
|
||
<p><strong>Windows:</strong></p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>activate catalyst
|
||
</pre></div>
|
||
</div>
|
||
</li>
|
||
<li><p class="first">Install the Catalyst inside the environment:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>pip install enigma-catalyst matplotlib
|
||
</pre></div>
|
||
</div>
|
||
</li>
|
||
<li><p class="first">Verify that Catalyst is installed correctly:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>catalyst --version
|
||
</pre></div>
|
||
</div>
|
||
<p>which should display the current version.</p>
|
||
</li>
|
||
</ol>
|
||
<p>Congratulations! You now have Catalyst properly installed.</p>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="installing-with-pip">
|
||
<span id="pip"></span><h2>Installing with <code class="docutils literal"><span class="pre">pip</span></code><a class="headerlink" href="#installing-with-pip" title="Permalink to this headline">¶</a></h2>
|
||
<p>Installing Catalyst via <code class="docutils literal"><span class="pre">pip</span></code> is slightly more involved than the average
|
||
Python package.</p>
|
||
<p>There are two reasons for the additional complexity:</p>
|
||
<ol class="arabic simple">
|
||
<li>Catalyst ships several C extensions that require access to the CPython C
|
||
API. In order to build the C extensions, <code class="docutils literal"><span class="pre">pip</span></code> needs access to the
|
||
CPython header files for your Python installation.</li>
|
||
<li>Catalyst depends on <a class="reference external" href="http://www.numpy.org/">numpy</a>, the core library for
|
||
numerical array computing in Python. Numpy depends on having the <a class="reference external" href="http://www.netlib.org/lapack">LAPACK</a> linear algebra routines available.</li>
|
||
</ol>
|
||
<p>Because LAPACK and the CPython headers are non-Python dependencies, the
|
||
correctway to install them varies from platform to platform. If you’d rather
|
||
use a single tool to install Python and non-Python dependencies, or if you’re
|
||
already using <a class="reference external" href="http://continuum.io/downloads">Anaconda</a> as your Python
|
||
distribution, refer to the <a class="reference internal" href="#conda"><span class="std std-ref">Installing with Conda</span></a> section.</p>
|
||
<p>If you use Python for anything other than Catalyst, we <strong>strongly</strong> recommend
|
||
that you install in a <a class="reference external" href="https://virtualenv.readthedocs.org/en/latest">virtualenv</a>. The <a class="reference external" href="http://docs.python-guide.org/en/latest/">Hitchhiker’s Guide to
|
||
Python</a> provides an <a class="reference external" href="http://docs.python-guide.org/en/latest/dev/virtualenvs/">excellent tutorial on virtualenv</a>. Here’s a
|
||
summarized version:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ pip install virtualenv
|
||
$ virtualenv catalyst-venv
|
||
$ <span class="nb">source</span> ./catalyst-venv/bin/activate
|
||
</pre></div>
|
||
</div>
|
||
<p>Once you’ve installed the necessary additional dependencies for your system
|
||
(<a class="reference internal" href="#linux"><span class="std std-ref">GNU/Linux Requirements</span></a>, <a class="reference internal" href="#macos"><span class="std std-ref">MacOS Requirements</span></a> or <a class="reference internal" href="#windows"><span class="std std-ref">Windows Requirements</span></a>) <strong>and have activated your virtualenv</strong>, you should be able to simply run</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ pip install enigma-catalyst matplotlib
|
||
</pre></div>
|
||
</div>
|
||
<p>Note that in the command above we install two different packages. The second
|
||
one, <code class="docutils literal"><span class="pre">matplotlib</span></code> is a visualization library. While it’s not strictly
|
||
required to run catalyst simulations or live trading, it comes in very handy
|
||
to visualize the performance of your algorithms, and for this reason we
|
||
recommend you install it, as well.</p>
|
||
<div class="section" id="troubleshooting-pip-install">
|
||
<h3>Troubleshooting <code class="docutils literal"><span class="pre">pip</span></code> Install<a class="headerlink" href="#troubleshooting-pip-install" title="Permalink to this headline">¶</a></h3>
|
||
<dl class="docutils">
|
||
<dt><strong>Issue</strong>:</dt>
|
||
<dd>Package enigma-catalyst cannot be found</dd>
|
||
<dt><strong>Solution</strong>:</dt>
|
||
<dd><p class="first">Make sure you have the most up-to-date version of pip installed, by running:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ pip install --upgrade pip
|
||
</pre></div>
|
||
</div>
|
||
<p>On Windows, the recommended command is:</p>
|
||
<div class="last highlight-bash"><div class="highlight"><pre><span></span>$ python -m pip install --upgrade pip
|
||
</pre></div>
|
||
</div>
|
||
</dd>
|
||
</dl>
|
||
<hr class="docutils" />
|
||
<dl class="docutils">
|
||
<dt><strong>Issue</strong>:</dt>
|
||
<dd><p class="first">Package enigma-catalyst cannot still be found, even after upgrading pip
|
||
(see above), with an error similar to:</p>
|
||
<div class="last highlight-bash"><div class="highlight"><pre><span></span>Downloading/unpacking enigma-catalyst
|
||
Could not find a version that satisfies the requirement enigma-catalyst
|
||
<span class="o">(</span>from versions: <span class="m">0</span>.1.dev9, <span class="m">0</span>.2.dev2, <span class="m">0</span>.1.dev4, <span class="m">0</span>.1.dev5, <span class="m">0</span>.1.dev3,
|
||
<span class="m">0</span>.2.dev1, <span class="m">0</span>.1.dev8, <span class="m">0</span>.1.dev6<span class="o">)</span>
|
||
Cleaning up...
|
||
No distributions matching the version <span class="k">for</span> enigma-catalyst
|
||
</pre></div>
|
||
</div>
|
||
</dd>
|
||
<dt><strong>Solution</strong>:</dt>
|
||
<dd><p class="first">In some systems (this error has been reported in Ubuntu), pip is configured
|
||
to only find stable versions by default. Since Catalyst is in alpha
|
||
version, pip cannot find a matching version that satisfies the installation
|
||
requirements. The solution is to include the <cite>–pre</cite> flag to include
|
||
pre-release and development versions:</p>
|
||
<div class="last highlight-bash"><div class="highlight"><pre><span></span>$ pip install --pre enigma-catalyst
|
||
</pre></div>
|
||
</div>
|
||
</dd>
|
||
</dl>
|
||
<hr class="docutils" />
|
||
<dl class="docutils">
|
||
<dt><strong>Issue</strong>:</dt>
|
||
<dd>Package enigma-catalyst fails to install because of outdated setuptools</dd>
|
||
<dt><strong>Solution</strong>:</dt>
|
||
<dd><p class="first">Upgrade to the most up-to-date setuptools package by running:</p>
|
||
<div class="last highlight-bash"><div class="highlight"><pre><span></span>$ pip install --upgrade pip setuptools
|
||
</pre></div>
|
||
</div>
|
||
</dd>
|
||
</dl>
|
||
<hr class="docutils" />
|
||
<dl class="docutils">
|
||
<dt><strong>Issue</strong>:</dt>
|
||
<dd>Missing required packages</dd>
|
||
<dt><strong>Solution</strong>:</dt>
|
||
<dd><p class="first">Download <a class="reference external" href="https://github.com/enigmampc/catalyst/blob/master/etc/requirements.txt">requirements.txt</a>
|
||
(click on the <em>Raw</em> button and Right click -> Save As…) and use it to
|
||
install all the required dependencies by running:</p>
|
||
<div class="last highlight-bash"><div class="highlight"><pre><span></span>$ pip install -r requirements.txt
|
||
</pre></div>
|
||
</div>
|
||
</dd>
|
||
</dl>
|
||
<hr class="docutils" />
|
||
<dl class="docutils">
|
||
<dt><strong>Issue</strong>:</dt>
|
||
<dd>Installation fails with error:
|
||
<code class="docutils literal"><span class="pre">fatal</span> <span class="pre">error:</span> <span class="pre">Python.h:</span> <span class="pre">No</span> <span class="pre">such</span> <span class="pre">file</span> <span class="pre">or</span> <span class="pre">directory</span></code></dd>
|
||
<dt><strong>Solution</strong>:</dt>
|
||
<dd><p class="first">Some systems (this issue has been reported in Ubuntu) require <cite>python-dev</cite>
|
||
for the proper build and installation of package dependencies. The solution
|
||
is to install python-dev, which is independent of the virtual environment.
|
||
In Ubuntu, you would need to run:</p>
|
||
<div class="last highlight-bash"><div class="highlight"><pre><span></span>$ sudo apt-get install python-dev
|
||
</pre></div>
|
||
</div>
|
||
</dd>
|
||
</dl>
|
||
<hr class="docutils" />
|
||
<dl class="docutils">
|
||
<dt><strong>Issue</strong>:</dt>
|
||
<dd>Missing TA_Lib</dd>
|
||
<dt><strong>Solution</strong>:</dt>
|
||
<dd>Follow <a class="reference external" href="https://mrjbq7.github.io/ta-lib/install.html">these instructions</a> to install the TA_Lib Python wrapper
|
||
(and if needed, its underlying C library as well).</dd>
|
||
</dl>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="installing-with-pipenv">
|
||
<span id="pipenv"></span><h2>Installing with <code class="docutils literal"><span class="pre">pipenv</span></code><a class="headerlink" href="#installing-with-pipenv" title="Permalink to this headline">¶</a></h2>
|
||
<p>Installing Catalyst via <code class="docutils literal"><span class="pre">pipenv</span></code> is perhaps easier that installing it via
|
||
<code class="docutils literal"><span class="pre">pip</span></code> itself but you need to install <code class="docutils literal"><span class="pre">pipenv</span></code> first via <code class="docutils literal"><span class="pre">pip</span></code>.</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ pip install pipenv
|
||
</pre></div>
|
||
</div>
|
||
<p>Once <code class="docutils literal"><span class="pre">pipenv</span></code> is installed you can proceed by creating a project folder and
|
||
installing Catalyst on that project automagically as follows:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ mkdir project
|
||
$ <span class="nb">cd</span> project
|
||
$ pipenv --two
|
||
$ pipenv install enigma-catalyst matplotlib
|
||
</pre></div>
|
||
</div>
|
||
<p>Until now the workflow compared to <code class="docutils literal"><span class="pre">pip</span></code> is almost identical, the difference
|
||
is that you don’t need to load manually any virtualenv however you need to use
|
||
the <cite>pipenv run</cite> prefix to run the <cite>catalyst</cite> command as follows:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ pipenv run catalyst --version
|
||
</pre></div>
|
||
</div>
|
||
<p>If you want to know more about <code class="docutils literal"><span class="pre">pipenv</span></code> go to the <a class="reference external" href="https://github.com/pypa/pipenv">pipenv github repo</a></p>
|
||
</div>
|
||
<div class="section" id="gnu-linux-requirements">
|
||
<span id="linux"></span><h2>GNU/Linux Requirements<a class="headerlink" href="#gnu-linux-requirements" title="Permalink to this headline">¶</a></h2>
|
||
<p>On <a class="reference external" href="https://www.debian.org/misc/children-distros">Debian-derived</a> Linux distributions, you can acquire all the necessary
|
||
binary dependencies from <code class="docutils literal"><span class="pre">apt</span></code> by running:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo apt-get install libatlas-base-dev python-dev gfortran pkg-config libfreetype6-dev
|
||
</pre></div>
|
||
</div>
|
||
<p>On recent <a class="reference external" href="https://en.wikipedia.org/wiki/Red_Hat_Enterprise_Linux_derivatives">RHEL-derived</a> derived Linux distributions (e.g. Fedora), the
|
||
following should be sufficient to acquire the necessary additional
|
||
dependencies:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo dnf install atlas-devel gcc-c++ gcc-gfortran libgfortran python-devel redhat-rep-config
|
||
</pre></div>
|
||
</div>
|
||
<p>On <a class="reference external" href="https://www.archlinux.org/">Arch Linux</a>, you can acquire the additional dependencies via <code class="docutils literal"><span class="pre">pacman</span></code>:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ pacman -S lapack gcc gcc-fortran pkg-config
|
||
</pre></div>
|
||
</div>
|
||
<div class="section" id="amazon-linux-ami-notes">
|
||
<h3>Amazon Linux AMI Notes<a class="headerlink" href="#amazon-linux-ami-notes" title="Permalink to this headline">¶</a></h3>
|
||
<p>The packages <code class="docutils literal"><span class="pre">pip</span></code> and <code class="docutils literal"><span class="pre">setuptools</span></code> that come shipped by default are very
|
||
outdated. Thus, you first need to run:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ pip install --upgrade pip setuptools
|
||
</pre></div>
|
||
</div>
|
||
<p>The default installation is also missing the C and C++ compilers, which you
|
||
install by:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo yum install gcc gcc-c++
|
||
</pre></div>
|
||
</div>
|
||
<p>Then you should follow the regular installation instructions outlined at the
|
||
beginning of this page.</p>
|
||
</div>
|
||
</div>
|
||
<div class="section" id="macos-requirements">
|
||
<span id="macos"></span><h2>MacOS Requirements<a class="headerlink" href="#macos-requirements" title="Permalink to this headline">¶</a></h2>
|
||
<p>The version of Python shipped with MacOS by default is generally out of date,
|
||
and has a number of quirks because it’s used directly by the operating system.
|
||
For these reasons, many developers choose to install and use a separate Python
|
||
installation. The <a class="reference external" href="http://docs.python-guide.org/en/latest/">Hitchhiker’s Guide to Python</a> provides an excellent guide
|
||
to <a class="reference external" href="http://docs.python-guide.org/en/latest/">Installing Python on MacOS</a>,
|
||
which explains how to install Python with the <a class="reference external" href="http://brew.sh">Homebrew</a> manager.</p>
|
||
<p>Assuming you’ve installed Python with Homebrew, you’ll also likely need the
|
||
following brew packages:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ brew install freetype pkg-config gcc openssl
|
||
</pre></div>
|
||
</div>
|
||
<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><span></span>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></span>$ <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 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>
|
||
</div>
|
||
<div class="section" id="windows-requirements">
|
||
<span id="windows"></span><h2>Windows Requirements<a class="headerlink" href="#windows-requirements" title="Permalink to this headline">¶</a></h2>
|
||
<p>In Windows, you will first need to install the Microsoft Visual C++ Compiler,
|
||
which is different depending on the version of Python that you plan to use:</p>
|
||
<ul class="simple">
|
||
<li>Python 3.5, 3.6: <a class="reference external" href="http://landinghub.visualstudio.com/visual-cpp-build-tools">Visual C++ 2015 Build Tools</a>,
|
||
which installs Visual C++ version 14.0. <strong>This is the recommended version</strong></li>
|
||
<li>Python 2.7: <a class="reference external" href="https://www.microsoft.com/en-us/download/details.aspx?id=44266">Microsoft Visual C++ Compiler for Python 2.7</a>, which
|
||
installs version Visual C++ version 9.0</li>
|
||
</ul>
|
||
<p>This package contains the compiler and the set of system headers necessary for
|
||
producing binary wheels for Python packages. If it’s not already in your
|
||
system, download it and install it before proceeding to the next step. If you
|
||
need additional help, or are looking for other versions of Visual C++ for
|
||
Windows (only advanced users), follow <a class="reference external" href="https://wiki.python.org/moin/WindowsCompilers">this link</a>.</p>
|
||
<p>Once you have the above compiler installed, the easiest and best supported way
|
||
to install Catalyst in Windows is to use <a class="reference internal" href="#conda"><span class="std std-ref">Conda</span></a>. If you didn’t
|
||
any problems installing the compiler, jump to the <a class="reference internal" href="#conda"><span class="std std-ref">Conda</span></a> section,
|
||
otherwise keep on reading to troubleshoot the C++ compiler installtion.</p>
|
||
<p>Some problems we have encountered installing the <strong>Visual C++ Compiler</strong>
|
||
mentioned above are as follows:</p>
|
||
<ul>
|
||
<li><p class="first"><strong>The system administrator has set policies to prevent this installation</strong>.</p>
|
||
<p>In some systems, there is a default <em>Windows Software Restriction</em> policy
|
||
that prevents the installation of some software packages like this one.
|
||
You’ll have to change the Registry to circumvent this:</p>
|
||
<ul class="simple">
|
||
<li>Click <code class="docutils literal"><span class="pre">Start</span></code>, and search for <code class="docutils literal"><span class="pre">regedit</span></code> and launch the
|
||
<code class="docutils literal"><span class="pre">Registry</span> <span class="pre">Editor</span></code></li>
|
||
<li>Navigate to the following folder:
|
||
<code class="docutils literal"><span class="pre">HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer</span></code></li>
|
||
<li>If the last folder does not exist, create it by right-clicking on the
|
||
parent folder and choosing -> <code class="docutils literal"><span class="pre">New</span></code> -> <code class="docutils literal"><span class="pre">Key</span></code> and typing <code class="docutils literal"><span class="pre">Installer</span></code></li>
|
||
<li>If there is an entry for <code class="docutils literal"><span class="pre">DisableMSI</span></code>, set the Value data to 0.</li>
|
||
<li>If there is no such entry, click on the <code class="docutils literal"><span class="pre">Edit</span></code> menu -> <code class="docutils literal"><span class="pre">New</span></code> ->
|
||
<code class="docutils literal"><span class="pre">DWORD</span> <span class="pre">(32-bit)</span> <span class="pre">Value</span></code> and enter <code class="docutils literal"><span class="pre">DisableMSI</span></code> as the Name (and by
|
||
default you get 0 as the Value Data)</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
<div class="line-block">
|
||
<div class="line"><br /></div>
|
||
</div>
|
||
<ul>
|
||
<li><p class="first"><strong>The installer has encountered an unexpected error installing this package.
|
||
This may indicate a problem with this package. The error code is 2503.</strong></p>
|
||
<p>We have observed this when trying to install a package without enough
|
||
administrator permissions. Even when you are logged in as an Administrator,
|
||
you have to explictily install this package with administrator privileges:</p>
|
||
<ul class="simple">
|
||
<li>Click <code class="docutils literal"><span class="pre">Start</span></code> and find <code class="docutils literal"><span class="pre">CMD</span></code> or <code class="docutils literal"><span class="pre">Command</span> <span class="pre">Prompt</span></code></li>
|
||
<li>Right click on it and choose <code class="docutils literal"><span class="pre">Run</span> <span class="pre">as</span> <span class="pre">administrator</span></code></li>
|
||
<li><code class="docutils literal"><span class="pre">cd</span></code> into the folder where you downloaded <code class="docutils literal"><span class="pre">VCForPython27.msi</span></code></li>
|
||
<li>Run <code class="docutils literal"><span class="pre">msiexec</span> <span class="pre">/i</span> <span class="pre">VCForPython27.msi</span></code></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
<div class="section" id="updating-catalyst">
|
||
<h2>Updating Catalyst<a class="headerlink" href="#updating-catalyst" title="Permalink to this headline">¶</a></h2>
|
||
<p>Catalyst is currently in alpha and in under very active development. We release
|
||
new minor versions every few days in response to the thorough battle testing
|
||
that our user community puts Catalyst in. As a result, you should expect to
|
||
update Catalyst frequently. Once installed, Catalyst can easily be updated as a
|
||
<code class="docutils literal"><span class="pre">pip</span></code> package regardless of the environemnt used for installation. Make sure
|
||
you activate your environment first as you did in your first install, and then
|
||
execute:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ pip uninstall enigma-catalyst
|
||
$ pip install enigma-catalyst
|
||
</pre></div>
|
||
</div>
|
||
<p>Alternatively, you could update Catalyst issuing the following command:</p>
|
||
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ pip install -U enigma-catalyst
|
||
</pre></div>
|
||
</div>
|
||
<p>but this command will also upgrade all the Catalyst dependencies to the latest
|
||
versions available, and may have unexpected side effects if a newer version of a
|
||
dependency inadvertently breaks some functionality that Catalyst relies on.
|
||
Thus, the first method is the recommended one.</p>
|
||
</div>
|
||
<div class="section" id="getting-help">
|
||
<h2>Getting Help<a class="headerlink" href="#getting-help" title="Permalink to this headline">¶</a></h2>
|
||
<p>If after following the instructions above, and going through the
|
||
<em>Troubleshooting</em> sections, you still experience problems installing Catalyst,
|
||
you can seek additional help through the following channels:</p>
|
||
<ul class="simple">
|
||
<li>Join our <a class="reference external" href="https://catalyst.enigma.co/">Catalyst Forum</a>, and browse a variety
|
||
of topics and conversations around common issues that others face when using
|
||
Catalyst, and how to resolve them. And join the conversation!</li>
|
||
<li>Join our <a class="reference external" href="https://discord.gg/SJK32GY">Discord community</a>, and head over
|
||
the #catalyst_dev channel where many other users (as well as the project
|
||
developers) hang out, and can assist you with your particular issue. The
|
||
more descriptive and the more information you can provide, the easiest will
|
||
be for others to help you out.</li>
|
||
<li>Report the problem you are experiencing on our
|
||
<a class="reference external" href="https://github.com/enigmampc/catalyst/issues">GitHub repository</a>
|
||
following the guidelines provided therein. Before you do so, take a moment
|
||
to browse through all <a class="reference external" href="https://github.com/enigmampc/catalyst/issues?utf8=%E2%9C%93&q=is%3Aissue">previous reported issues</a>
|
||
in the likely case that someone else experienced that same issue before,
|
||
and you get a hint on how to solve it.</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
<div class="articleComments">
|
||
|
||
</div>
|
||
</div>
|
||
<footer>
|
||
|
||
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
|
||
|
||
<a href="beginner-tutorial.html" class="btn btn-neutral float-right" title="Catalyst Beginner Tutorial" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||
|
||
|
||
<a href="index.html" class="btn btn-neutral" title="Overview" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||
|
||
</div>
|
||
|
||
|
||
<hr/>
|
||
|
||
<div role="contentinfo">
|
||
<p>
|
||
© Copyright 2018, Enigma MPC, Inc..
|
||
|
||
</p>
|
||
</div>
|
||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||
|
||
</footer>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
</section>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
<script type="text/javascript">
|
||
var DOCUMENTATION_OPTIONS = {
|
||
URL_ROOT:'./',
|
||
VERSION:'0.4',
|
||
COLLAPSE_INDEX:false,
|
||
FILE_SUFFIX:'.html',
|
||
HAS_SOURCE: true,
|
||
SOURCELINK_SUFFIX: '.txt'
|
||
};
|
||
</script>
|
||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||
|
||
|
||
|
||
|
||
|
||
<script type="text/javascript" src="_static/js/theme.js"></script>
|
||
|
||
|
||
|
||
|
||
<script type="text/javascript">
|
||
jQuery(function () {
|
||
SphinxRtdTheme.StickyNav.enable();
|
||
});
|
||
</script>
|
||
|
||
|
||
</body>
|
||
</html> |