{ "metadata": { "name": "", "signature": "sha256:9478c655e0affabb05e3b41d393f3b29c9b6d5427f5d9dfa1a50e5dbaf16b536" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "PyGChem Installation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The PyGChem package can be installed either as a [conda](http://conda.pydata.org/) package or from source." ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "The easy way" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "*Note: currently, this alternative is only available for:*\n", "- *64 bit Linux (it has been tested on Debian 6 and OpenSUSE 12.3 and 13.1, but it should work with other recent distributions).*\n", "- *64 bit OSX (tested only on OSX 10.9 with Xcode 5.0).*\n", "\n", "The easiest way to install PyGChem is to first get the free [Anaconda](https://store.continuum.io/cshop/anaconda/) distribution. There are two options:\n", "\n", "- Anaconda : includes Python (2.x or 3.x), the conda package manager and 195+ common scientific packages preinstalled ()\n", "- Miniconda : only includes Python and the conda package manager (). Additional packages can be installed later.\n", "\n", "Download the installer corresponding to your platform and follow the installation steps. Administrator privileges are not required. Note that it is a completely independent Python installation, it will not conflict with any version of Python already installed on your system.\n", "\n", "Make sure that the Anaconda or Miniconda install location has been added to your PATH (it should be the case, unless you have explicitly chosen not to add it). The following command (Linux, OSX) will add it to you PATH, if needed:\n", "\n", " export PATH=/$HOME/anaconda/bin:$PATH\n", " \n", "If you wish to use Anaconda or Miniconda as your default Python installation, you should add the install location to your `.bashrc` or `.profile` (it should be already there by default).\n", "\n", "The next step (optional but recommended) is to create a new virtual environment where PyGChem and all its [dependencies](#Dependencies) will be installed:\n", "\n", " conda create -n pygchem_py27 python=2.7\n", "\n", "Virtual environments allow you to have multiple versions of Python and/or libraries installed on your system and easily switch between them.\n", "\n", "You can then activate the new created virtual environment:\n", "\n", " source activate pygchem_py27\n", "\n", "The last step is to install PyGChem and all its dependencies into the activated virtual environment. Simply run the following command:\n", "\n", " conda install -c https://conda.binstar.org/benbovy pygchem\n", "\n", "To check if PyGChem has been successfully installed, try importing it:\n", "\n", " python -c \"import pygchem; import iris\"\n", "\n", "NOTE: The installed package (more specifically, some of its dependencies) may not work for OSX versions earlier than 10.9. If you use one of these systems and if importing the modules fails, try re-installing the following packages from Christoph Keller's repository:\n", "\n", " conda install -f -c https://conda.binstar.org/christophkeller pygchem iris biggus cartopy udunits2 proj4" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Installing from source" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The PyGChem's source is available here: . If you have [git](http://git-scm.com/) installed on your system, you can download the source with the following command:\n", "\n", " git clone https://github.com/benbovy/PyGChem.git\n", "\n", "After having installed all the [dependencies](#Dependencies) listed below, you can install PyGChem by running the commands:\n", "\n", " cd PyCGhem\n", " git checkout \n", " python setup.py install\n", "\n", "`` is a specific release (e.g., '0.2.0', '0.3.0dev'). The master branch (default) contains the actual state of the code (may be unstable)." ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "In-place install (an alternative for developers)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you wish to contribute to the development of PyGChem, an in-place install can be useful. You can perform an in-place build by entering:\n", "\n", " python setup.py develop\n", "\n", "It will add the current source directory to the Python `sys.path` so you don't have to re-install the package each time you modify the source." ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Dependencies" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The following external packages or libraries are required before installing and running PyGChem:\n", "\n", "- Python 2.7+ (http://www.python.org/)\n", " - not yet compatible with Python 3.x\n", "\n", "- Numpy 1.6+ (http://numpy.scipy.org/) \n", " - Python core package for scientific computing (array manipulation)\n", "\n", "- netcdf4-python 0.9.9+ (http://netcdf4-python.googlecode.com/)\n", " - Python interface to the netCDF version 4 C library.\n", "\n", "- Iris 1.7+ (http://scitools.org.uk/iris)\n", " - Python implementation of the CF data model.\n", " - additional requirements: Scipy, Biggus, Cartopy, PyKE, udunits2\n", "\n", "- setuptools 0.6c11 (http://pypi.python.org/pypi/setuptools/)\n", " - install / remove Python packages\n", "\n", "The following packages are optional:\n", "\n", "- IPython (notebook) 2.0+ (http://ipython.org/)\n", " - For running the tutorials and examples\n", "\n", "\n", "Most of these libraries can be installed using your platform-specific package manager or from several (free) Python scientific distributions:\n", "- Anaconda (https://store.continuum.io/cshop/anaconda/)\n", "- Enthought's Canopy (https://www.enthought.com/products/canopy/)\n", "- Python XY (http://code.google.com/p/pythonxy/)\n" ] } ], "metadata": {} } ] }