Install

Requirements

  • Python 2.7 or later

  • Tornado 4.0 or later

  • passlib 1.6.2 or later (eventually this will be optional and only required for password protected toyz applications)

  • six

  • numpy 1.5.1 or later
    • Required to load saved .npy files

Installing Toyz

The Toyz framework only needs to be installed on the machine acting as the server. This can be a local machine, remote server, or even remote super-computer (we are working on testing this on a blue-gene super computer at the University of Rochester at this time).

Anaconda Users

The easiest way I’ve found to ensure that all of your scientific python modules cooperate with each other is to install Anaconda. Follow the anaconda documentation to setup a new conda environment and install all of the required and optional packages above. Then follow the instructions below in the Using pip to install from PYPI section.

Using a virtualenv

If you are not using anaconda, the next best option is to use virtualenv. For those new to python you will soon discover that while the language is fairly OS agnostic one of its biggest advantages and issues is its modular layout. Most packages depend on other 3rd party packages not distributed with the main python standard library. Because many of these packages are under constant development there can be instances where a 3rd party library might have a conflict with a different third party library and cause certain feature of toyz to malfunction.

virtualenv is a package that allows you to setup virtual python environments that allow a single machine to have multiple versions of the same package installed. Below are tips in creating a virtual environment that you can use to install toyz.

To install virtualenv

$ pip install virtualenv

Now navigate to a folder that will become the parent of your virtual environment, for example:

$ cd ~

Now you can create a virtual environment

$ virtualenv toyzenv

This creates a virtual environment but now you must activate it using

$ source toyzenv/bin/activate

For the rest of your terminal session you will see your prompt preceeded by (toyzenv). Now any packages you install via pip or from source using python setup.py install will be installed to the virtual environment, not your system wide python installation. You will have to run source toyzenv/bin/activate every time you open a new terminal unless you add it to your .bash_profile. To exit the virtual environment at any time simply type

(toyzenv) $ deactivate

and you will return to your system wide python environment. Once you have activated your new virtual environment proceed to Using pip to install from PYPI.

Note

One of the advantages to using anaconda instead of virtualenv is that anaconda already contains multiple pre-compiled versions of almost all of the packages toyz is dependent on, meaning it is much faster to install. If you are installing a new virtual environment it can take a long time to download and compile numpy, scipy, and astropy (if you are using astrotoyz).

Using pip to install from PYPI

Warning

The current version of toyz on pypi is not working correctly! For the time being toyz must be installed from source. This should change by September 2015

Warning

If you are not using anaconda or virtualenv proceed with caution, some of the dependencies of Toyz may have conflicts with other packages and we are still tracing the origin of these errors (see Using a virtualenv for more).

Toyz is registered in the Python Package Index (pypi) and can be installed using

pip install toyz

To install all of the required and optional dependencies use

pip install toyz[all]

Some packages like numpy, scipy, and astropy might take a while to compile.

Note

pip can also be used to install the source code (see Installing from source)

Installing from source

Obtaining the source code

Download the source code here on github, or by typing:

git clone git://github.com/fred3m/toyz.git

Installing

To install Toyz from the source code if you already have all of the dependencies, navigate to the root directory of the source code and type:

python setup.py install

To install all of the required and optional dependencies navigate to the root directory of the source code and type

pip install -e .[all]

Note

On unix systems you may be required to prepend ‘sudo‘ to your install command:

sudo python setup.py install

As this is a new package, please let me know any problems you have had installing the source code so I can fix them or share steps needed to resolve them with other users. For bugs, please create an issue on github. For other comments or suggestions please create a post on our Google Group