Detailed Installation Instructions¶
The following is addressed to an audience who is just getting started with Python and would benefit from additional guidance on how to install PyStan.
Installing PyStan requires installing:
- Python dependencies
It is highly recommended to know what
bash is and the basics of
navigating the terminal. You can review or learn it from the Software
Carpentry bash lesson here:
Lessons 1 - 3 are proabably the most important.
The easiest way to install Python is to use the Anaconda distribution of python. It can be downloaded here: http://continuum.io/downloads.
This is because PyStan (and many python tools) require packages (aka
modules) that have C dependencies. These types of dependencies are
unable to be installed (at least easily) using
pip, which is a
common way to install python packages. Anaconda ships with it’s own
package manager (that also plays nicely with
and comes with many of the data analytics packages and dependencies
Don’t worry about Anaconda ruining your current Python installation, can can be easily uninstalled (described below).
Anaconda is not a requirement¶
Anaconda is not an absolute requirement to get
pystan to work. As
long as you can get the necessary python dependencies installed, pystan
will work. If you want to install Anaconda, follow the Windows, Macs,
and Linux instructions below.
The Anaconda installer should be able to be double-clicked and installed. Use all of the defaults for installation except make sure to check Make Anaconda the default Python.
After downloading the installer, double click the .pkg file and follow the instructions on the screen. Use all of the defaults for installation.
After downloading the installer execute the associated shell script. For
example, if the file downloaded were named
you would enter
bash Anaconda3-4.1.1-Linux-x86_64.sh in the directory where
you downloaded the file.
The default location for anaconda can be found in your home directory.
Typically this means it in in the
directory when you open a terminal.
If you used the Anaconda installer, numpy and cython should already be
installed, so additional dependencies should not be needed. However,
should you need to install additional dependencies, we can use
to install them as such:
- open a terminal
conda install numpyto install numpy or replace
numpywith the package you need to install
Since we have the
cython dependencies we need, we can
install the latest version of PyStan using
pip. To do so:
- Open a terminal
pip install pystan