Department of Physics and Astronomy

The Forbes Group

Conda Pip and All That

$\newcommand{\vect}[1]{\mathbf{#1}} \newcommand{\uvect}[1]{\hat{#1}} \newcommand{\abs}[1]{\lvert#1\rvert} \newcommand{\norm}[1]{\lVert#1\rVert} \newcommand{\I}{\mathrm{i}} \newcommand{\ket}[1]{\left|#1\right\rangle} \newcommand{\bra}[1]{\left\langle#1\right|} \newcommand{\braket}[1]{\langle#1\rangle} \newcommand{\op}[1]{\mathbf{#1}} \newcommand{\mat}[1]{\mathbf{#1}} \newcommand{\d}{\mathrm{d}} \newcommand{\pdiff}[3][]{\frac{\partial^{#1} #2}{\partial {#3}^{#1}}} \newcommand{\diff}[3][]{\frac{\d^{#1} #2}{\d {#3}^{#1}}} \newcommand{\ddiff}[3][]{\frac{\delta^{#1} #2}{\delta {#3}^{#1}}} \DeclareMathOperator{\erf}{erf} \DeclareMathOperator{\Tr}{Tr} \DeclareMathOperator{\order}{O} \DeclareMathOperator{\diag}{diag} \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\sech}{sech} $

In this post I describe my strategy for managing source code projects and dependencies with python, Conda, [Pip][], etc. I also show how to to maintain your own "PyPI" for source code packages.

Overview

Current Strategy

:::{margin} Just make sure you use dependencies: rather than packages: in anaconda-project.yaml. This will allow conda env to also use the file. ::: Our current strategy is to manage conda environments on a per-project basis using Anaconda Project. Carefully structured, the associated anaconda-project.yaml file can act as a replacement for environment.yml files. This can take more disk space than using monolithic work environments like we used to do, but we mitigate this with some of the following principles:

  • Don't include build tools such as [Poetry][], [Black][], [Mercurial][] etc. in the environment as this can cause dependency issues and bloat. Instead, install these with e.g. [PipX][]. I do the following:

    pipx install poetry
    pipx install git+https://github.com/cookiecutter/cookiecutter.git@2.0.2#cookiecutter
    pipx install black
    pipx install nox
    pipx install poetry2conda
    pipx install conda-lock
    pipx install condax
    pipx install rst-to-myst
    pipx install twine
    pipx install mercurial
    pipx install mmf_setup
    pipx inject nox nox-poetry poetry 
    pipx inject mercurial hg-git hg-evolve
    
  • Don't included the conda-forge channel by default. Specify it only when needed like conda-forge::myst-nb. This generally keeps the search/build times small, but can have issues with complicated dependencies that require pinning other requirements as coming from conda-forge. It is fine to fallback and include the conda-forge channel, but keep in mind that creating the environment may take much longer. (Mamba can help in these cases.)

  • Consider using [Conda][] proper to manage only those packages that are complicated, difficult to build, or have binary dependencies (things like numpy, scipy, matplotlib, numba etc.), and then use Pip or [Poetry][] to manage the rest. This works out of the box with Pip, but needs a little bit of help with [Poetry][]. We use the additional functionality of adding commands in anaconda-project.yaml to do any additional provisioning (such as installing IPython kernels for use in Jupyter).

  • To start a new project, take a look at using our cookiecutters. These provide templates for new projects with a working skeleton anaconda-project.yaml file with support for documentation hosted on Read the Docs (e.g. Physics 555: Quantum Technologies and Computation), a Makefile for initializing environments on CoCalc, automatic testing, CI, and many other features.

If you need to install new packages, here are some options:

  1. If the packages you need are pip-installable, then you can install them locally in PYTHONUSERBASE. This defaults to ~/.local/:

    conda activate work
     python -m pip install --user ...
    

    For example, with Python 3.8 on linux, this will install the packages in ~/.local/lib/python3.8/ with binaries in ~/.local/bin/ etc. This is convenient, but does not completely isolate your environment – any version of python3.8 will have access to these. (A potential issue is that the installed packages might depend on libraries in the underlying conda environment, which may then be unavailable in other environments.)

    A safer approach is to use a virtual environment (venv) with access to the system site packages – i.e. those in the conda environment:

    cd <your project>
     conda activate work
     python3 -m venv --system-site-packages .venv
    

    This will create a local virtual environment in .venv in which any new packages will be installed, but which will still have access to the packages in the work conda environment.

    Limitations

    • It can be a little confusing having both conda and venv's active. You should be careful to activate the venv only after any conda environment, or without any conda environments active. If you activate a conda environment after activating the venv, things can get quite messed up.
    • I don't have a good solution yet for making a completely reproducible environment file: conda list will not find packages installed in the venv. You can list these with pip list or pip freeze, but these will not include those in the conda environment. This will be addressed below when we discuss poetry.
  2. Unfortunately, this will not work with packages that need conda to install. If you have such additional dependencies, then your best option is to create a clone:

    conda create -n mywork --clone work
     conda activate mywork
     conda install ...
    

Limitations

There are a few issues with our suggested approach of using read-only conda environments:

  • conda run cannot be used when the environment is read-only: Conda issue #10690. However, many programs can simply be run by symlinking the appropriate executable somewhere like ~/.local/bin/ on your path.
  • Cloning environments can take quite a bit of memory. In principle, hardlinks should be used, but not everything can be linked... using a single environment would take less memory.

(To suggest additional packages, please create a topic and merge request in the forbes-group/configurations repository as discussed below.)

Pros:

  • Common environments are available for quickly getting down to work.
  • Environments stay clean, promoting reducibility.

Limitations:

There are two main domains of python packaging:

  1. Users who need to install packages.
  2. Developers who need to test and distribute packages.

In both cases, one would like to be able to work in reproducible computing environments, possibly working with a variety of different python versions. In any case, do not use or update the version of python installed for use by the system: this is asking for problems.

Instead, use one of the following strategies:

  • Conda: Provides an easy way of installing and activating independent python environments. In addition to python, conda is a full binary package manager able to install many tools and libraries beyond the python ecosystem. The main disadvantage of conda is that it can be very slow to install a new environment. To some extent, mamba.

    Pros: Cons:

  • pyenv: Pros:

    Cons:

References

As a general strategy, I am now trying to host everything on Anaconda Cloud so that all my packages and environments can be installed with Conda.

Within the Python community, the Python Packaging Authority (PyPA) provides the recommendations of the current working group, and we try to follow their guidelines as laid out in the Python Packaging User Guide.

My general strategy is to maintain Conda environments for each project and each main application, and to rely on these to ensure my projects work and can be easily distributed. In addition, I maintain a common work environment that has everything and the kitchen sink which I can "just use" to get work done. This is hosted on Anaconda Cloud so you can install it and use it with:

conda install anaconda-client
conda env create mforbes/work    # Don't run in a directory with an environment.yml file
conda activate work

Note: do not run this in a folder with an environment.yml file. See Issue #549.

This notebook describes some details about this strategy which consists of the following concepts:

  • Jupyter: This section discusses the jupyter environment where I install Jupyter and related tools.
    • I use a script to launch the Jupyter notebook server and/or Jupyter Lab so that this environment is first activated.
    • I use the nb_conda extension so that one can access the conda environments from Jupyter. (This requires ensuring that the ipykernel package is installed in each environment so that they can be found.)
    • I use the Jupytext extension so that you can store notebooks as python files for better version control. This requires a small manual change in your notebooks to enable.
  • Conda Environments: I try to package everything into Conda environments. There are several use-cases here:

    • Global environments such as work2 and work3 which have everything including the kitchen sink for python 2 and python 3 respectively. When I just need to get something done, I activate these and work. Don't rely on these for testing though: instead use minimal and dedicated environments for your code.
    • Dedicated and minimal project environments should be used for each project that contain the minimal number of packages required. Your tests should be run in these environments (plus any testing tools) so that you can be sure no undocumented dependencies creep in when you add new features. I usually keep two copies:

      • environment.yml: This contains the packages I need (leaves), usually without version specifications unless there is a known conflict. It can be kept clean as descibed in the section Visualizing Dependencies. To create or update the environment:

        conda env update -f environment.yml
        
      • environment.frozen.yml: This contains the explicit versions I am testing against to ensure reproducible computations. It can be formed by:

        conda activate <environment name>
         conda env export > environment.frozen.yml
        
  • Anaconda Cloud: I try to use my mforbes channel on Anaconda Cloud to host useful environments and packages. Ideally, all packages should be installable with only Conda. Some information about how to build and maintain Conda packages and environments is discussed in section Building a Conda Package.

TL;DR

Conda

  • Use conda to manage environments. (Conda can be slow: for faster installs you can try mamba, but it is still experimental.)
  • For each project, create an environment which will contain all the packages like NumPy, SciPy etc. needed for that project. (Also specify python 2 or python 3). Store these requirements in a project-specific environment.yml file.
  • Create an environment for that project that includes the ipykernel package:

    conda env create --file environment.yml
    

    (This assumes that environment.yml specifies the name of the environment, otherwise you need to pass conda the -n <env> flag).

  • Install Jupyter (see instructions below) in its own environment and include the nb_conda package. By including the ipykernel package in each environment and the nb_conda package in the jupyter environment, Jupyter will be able to find your environments and use them as kernels.
  • Launch Jupyter with a custom kernel for your project using the following function which will activate the jupyter environment first:

    # ~/.bashrc or similar
    
    function j { 
        if [ -f './jupyter_notebook_config.py' ]; then
            CONFIG_FLAG="--config=./jupyter_notebook_config.py";
        else
            if [ -f "$(hg root)/jupyter_notebook_config.py" ]; then
                CONFIG_FLAG="--config=$(hg root)/jupyter_notebook_config.py";
            else
                CONFIG_FLAG="";
            fi;
        fi;
        echo "conda activate jupyter";
        conda activate jupyter;
        echo "jupyter notebook ${CONFIG_FLAG} $*";
        jupyter notebook "${CONFIG_FLAG}" "$*";
        conda deactivate
    }
    
  • For development and testing, create a set of minimal environments with the versions you want to test against:

    envdir="$(conda info | grep 'envs directories' | awk 'NF>1{print $NF}')"
    for p in 2.7 3.5 3.6 3.7 3.8 3.9; do
      env=py${p}
      sudo chown mforbes "${envdir}/${env}"
      conda env remove -y -n ${env} 2> /dev/null
      rm -rf "${envdir}/${env}"
      conda create -f -y -c defaults --override-channels \
            --no-default-packages -n "${env}" python=${p}
      sudo chown admin "${envdir}/${env}"
      ln -s "${envdir}/${env}/bin/python${p}" ~/.local/bin/
    done
    conda clean --all -y
    

Pip

The following recommendations are based on using pip to manage dependencies. We are in the process of migrating to a more conda-centric version.

  • Provide a setup.py file for your source repositories that contains all of the dependency information in the install_requires argument to setup().
  • Structure your repository with tags and/or named branches so that you can hg update 0.9 etc. to update to the various versions.
  • Host an index.html file somewhere that points to the Download links of the various projects.
  • Use pip install --extra-index-url <index.html> to allow pip to resolve dependencies against your source code.

Poetry (Trial)

I am giving a poetry a try. This is a package for replacing setup.py providing virtual environments for development and testing.

Installation

conda deactivate    # Optional: deactivate conda environments
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
mkdir -p ~/.local/share/bash-completion/completions
poetry completions bash > ~/.local/share/bash-completion/completions/poetry.bash

This requires a modern version of bash. See issues #3418. I use

port install bash-completion
sudo echo /opt/local/bin/bash >> /etc/shells
chsh -s /opt/local/bin/bash
echo >> ~/.bashrc <<EOF
if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
  . /opt/local/etc/profile.d/bash_completion.sh
fi
EOF

To uninstall:

POETRY_UNINSTALL=1 bash -c 'curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python'

Usage

Follow the instructions to setup your project using a pyproject.toml file instead of setup.py. If you still want to be able to use source-installs (pip install -e), then make a stub setup.py file:

# setup.py
import setuptools

setuptools.setup()

When you want to develop the project, you should first set the python environment. If you follow my advice above, you will have various python versions available on your PATH such as python3.6, python3.7 etc. Get poetry to create a virtual environment with your chose as follows:

$ poetry env use python2.7 
Creating virtualenv wdata-6Y3wHwFr-py2.7 in ...Caches/pypoetry/virtualenvs
Using virtualenv: .../Caches/pypoetry/virtualenvs/wdata-6Y3wHwFr-py2.7
$ poetry env use python3.9
Creating virtualenv wdata-6Y3wHwFr-py3.9 in .../Caches/pypoetry/virtualenvs
Using virtualenv: .../Caches/pypoetry/virtualenvs/wdata-6Y3wHwFr-py3.9
...

Now you can do things like install the project in this environment, or run tests etc. For example, testing the packaged against Python 3.9 would be accomplished by:

poetry env use python3.9
poetry install
poetry run pytest

Nox

The following works with nox:

# noxfile.py
import nox
from nox.sessions import Session

@nox.session(python=["3.6", "3.7", "3.8", "3.9"])
def test(session: Session) -> None:
    """Run the test suite."""
    session.run("poetry", "env", "use", 
                session.virtualenv.interpreter, external=True)
    session.run("poetry", "install", external=True)
    session.run("poetry", "run", "pytest", external=True)

There may be better ways of getting this to work.

Cheatsheet

  • poetry config --list
  • poetry shell: Start a shell
  • poetry config repositories.testpypi https://test.pypi.org/legacy/
  • rm -rf "$(poetry config virtualenvs.path)": Remove virtual envs.
  • rm -rf "$(poetry config cache-dir)": Remove entire cache of virtual envs etc.

Issues

Conda

Conda and Anaconda provide quite complete python distributions for scientific computing. Unless I am specifically developing packages for general us, I allow myself to rely on the default Anaconda distribution. This includes the Conda package manager, which provides an alternative to virtualenv for managing environments.

There is a nice discussion of the state of conda here:

Conda has a few important benefits:

  • Many binary packages are supported, including some that are not python (and hence cannot be managed by pip).
  • Conda including builds of NumPy, SciPy, and Matplotlib that can be difficult to install from source.
  • Conda keeps track of your history (try conda list --revisions) which can help if you need to reproduce some history.
  • For educational use (or paid commercial use), one can install the Accelerate package.
  • Conda is aware of packages installed with pip so these can still be used.
  • Conda provides environments, replacing the need for virtualenv.

Cheatsheet

Working with packages:

  • conda update --all: Update all packages in an environment.
  • conda clean --all: Remove all downloaded packages and unused files. Can free significant amounts of disk space.

Working with environments:

  • conda activate <env>/conda deactivate: Activate or deactivate an environment.
  • conda env list: Show installed environments (and their location).
  • conda env update [ -n name ] ( -f environment.yml | channel/spec ) [ --prune ]: Update packages in an environment from a file or anaconda channel, optionally removing unnecessary files (but see this issue.)

Clone an environment:

  • Using conda-pack which must be installed (conda install -c conda-forge conda-pack):
    env=work            # Specify the name here
    conda pack -n "${env}" -o "${env}.tgz"
    tar -zxvf "$env.tgz" -C new_env_folder
    conda-unpack -p new_env_folder
    mamba install --force-reinstall olefile defusedxml python.app
    

Package Availablity

One issue when dealing with conda is that not all packages are available. There several ways to deal with this:

  1. Search for the package on another channel. The following channels seem to be reliable:

    • [conda-forge][]: This is a community driven project that provides an infrastructure for building and maintaining packages cleanly on Windows, Linux, and OS X. It is described in the post - Community powered conda packaging: conda-forge.
    • pipy To add a new channel:
    conda config --append channels conda-forge

    Then you can look with

    $ conda config --show
    add_anaconda_token: True
    add_pip_as_python_dependency: True
    allow_softlinks: True
    always_copy: False
    always_yes: False
    auto_update_conda: True
    binstar_upload: None
    changeps1: True
    channel_alias: https://conda.anaconda.org/
    channel_priority: True
    channels:
    - defaults
    - conda-forge
    client_cert: 
    client_cert_key: 
    create_default_packages: []
    debug: False
    default_channels:
    - https://repo.continuum.io/pkgs/free
    - https://repo.continuum.io/pkgs/pro
    disallow: []
    json: False
    offline: False
    proxy_servers: {}
    quiet: False
    shortcuts: True
    show_channel_urls: True
    ssl_verify: True
    track_features: []
    update_dependencies: True
    use_pip: True
    verbosity: 0
  2. Build your own conda package and upload it to Anaconda Cloud. It seems that contributing to [conda-forge][] is the preferred way to do this but I have not yet tried.

  3. Use pip. The disadvantage here is that packages are then managed by both conda and pip which can lead to some confusion, but this does work reasonably well and is how I used to do things for many years. The advantage is that you can specify your dependences simply with the standard setup.py file. I am not sure how to do this with conda yet.

+++

Getting Started

+++

My strategy is to install a minimal conda installation with python 2.0 and then add various environments as needed. Each project should have its own conda environment so that one can reproducibly manage the dependencies of that project. This ties together as follows:

  • The conda base environment and some custom environments (jupyter might be a good candidate) can be maintained at a system level by an admin. On my computers, these reside in:

    /data/apps/conda/   # System (mini)conda directory
    |-- envs/           # System-defined environments 
    |   |-- jupyter/    # Jupyter notebooks etc. with nb_conda extension
    |   `-- ...
    |-- bin/            # Executables for `base` environment
    `-- ...
  • The jupyter environment contains the nb_conda extension which allows one to choose kernels based on known conda environments. With this, you can run jupyter from the jupyter environment and use a specialize kernel for whatever computation you need. (For example, jupyter should be run with Python 3, but you may have kernels that are still Python 2. This approach means you do not need to include jupyter in you project environment.)

  • On a system where users cannot write to /data/apps/conda, environments created by the user will be automatically placed in:

    ~/.conda/envs/

    Thus, users can immediately create their own environments as needed.

  • If a user needs to create an environment in ~/.conda/envs/ that shadows an environment in /data/apps/conda/envs, then it seems this can be done by first making the appropriate directory, then using conda to install whatever is needed:

    $ conda create -n jupyter
    
     CondaValueError: prefix already exists: /data/apps/conda/envs/jupyter
    
     $ mkdir -p ~/.conda/envs/jupyter
     $ conda install -n jupyter ...
    

    This is probably a bit of a hack, but seems to work.

Miniconda

I first install Miniconda with Python 2.7.

  • I choose to use python 2.7 here because it allows me to install Mercurial which will likely not support Python 3 for some time.
  • I add the miniconda bin directory to the end of my path so that the hg command will fall through if I have activated a python 3 environment.
  • Other than mercurial and related tools, I keep the default environment clean.

Update Conda

After installing miniconda, I do an update:

In [2]:
%%bash
. deactivate 2> /dev/null       # Deactivate any environments
#conda install -y --revision=0  # Revert to original revision.  This is failing!  Removing conda
conda update -y conda           # Update conda 
conda update -y --all           # Update all other packages
conda list
Unsetting IPYTHONDIR
Unsetting TALENT2015DIR
Fetching package metadata .............
Solving package specifications: .

# All requested packages already installed.
# packages in environment at /data/apps/anaconda:
#
conda                     4.3.7                    py27_0    defaults
Fetching package metadata .............
Solving package specifications: .

# All requested packages already installed.
# packages in environment at /data/apps/anaconda:
#

# packages in environment at /data/apps/anaconda:
#
cffi                      1.9.1                    py27_0    defaults
conda                     4.3.7                    py27_0    defaults
conda-env                 2.6.0                         0    defaults
cryptography              1.7.1                    py27_0    defaults
enum34                    1.1.6                    py27_0    defaults
idna                      2.2                      py27_0    defaults
ipaddress                 1.0.18                   py27_0    defaults
openssl                   1.0.2j                        0    defaults
pip                       9.0.1                    py27_1    defaults
pyasn1                    0.1.9                    py27_0    defaults
pycosat                   0.6.1                    py27_1    defaults
pycparser                 2.17                     py27_0    defaults
pycrypto                  2.6.1                    py27_4    defaults
pyopenssl                 16.2.0                   py27_0    defaults
python                    2.7.13                        0    defaults
readline                  6.2                           2    defaults
requests                  2.12.4                   py27_0    defaults
ruamel_yaml               0.11.14                  py27_1    defaults
setuptools                27.2.0                   py27_0    defaults
six                       1.10.0                   py27_0    defaults
sqlite                    3.13.0                        0    defaults
tk                        8.5.18                        0    defaults
wheel                     0.29.0                   py27_0    defaults
yaml                      0.1.6                         0    defaults
zlib                      1.2.8                         3    defaults
anaconda-client           1.6.0                    py27_0    defaults
argcomplete               1.0.0                    py27_1    defaults
beautifulsoup4            4.5.3                    py27_0    defaults
cffi                      1.9.1                    py27_0    defaults
chardet                   2.3.0                    py27_0    defaults
clyent                    1.2.2                    py27_0    defaults
conda                     4.3.6                    py27_0    defaults
conda-build               2.1.1                    py27_0    defaults
conda-env                 2.6.0                         0    defaults
conda-verify              2.0.0                    py27_0    defaults
contextlib2               0.5.4                    py27_0    defaults
cryptography              1.7.1                    py27_0    defaults
dulwich                   0.16.3                    <pip>
enum34                    1.1.6                    py27_0    defaults
filelock                  2.0.7                    py27_0    defaults
futures                   3.0.5                    py27_0    defaults
hg-git                    0.8.5                     <pip>
idna                      2.2                      py27_0    defaults
ipaddress                 1.0.18                   py27_0    defaults
jinja2                    2.9.4                    py27_0    defaults
markupsafe                0.23                     py27_2    defaults
mercurial                 3.9.2                    py27_0    defaults
openssl                   1.0.2j                        0    defaults
pip                       9.0.1                    py27_1    defaults
pkginfo                   1.4.1                    py27_0    defaults
pyasn1                    0.1.9                    py27_0    defaults
pycosat                   0.6.1                    py27_1    defaults
pycparser                 2.17                     py27_0    defaults
pycrypto                  2.6.1                    py27_4    defaults
pyopenssl                 16.2.0                   py27_0    defaults
python                    2.7.13                        0    defaults
python-dateutil           2.6.0                    py27_0    defaults
python-hglib              2.2                       <pip>
pytz                      2016.10                  py27_0    defaults
pyyaml                    3.12                     py27_0    defaults
readline                  6.2                           2    defaults
requests                  2.12.4                   py27_0    defaults
ruamel_yaml               0.11.14                  py27_1    defaults
setuptools                27.2.0                   py27_0    defaults
six                       1.10.0                   py27_0    defaults
sqlite                    3.13.0                        0    defaults
tk                        8.5.18                        0    defaults
wheel                     0.29.0                   py27_0    defaults
yaml                      0.1.6                         0    defaults
zlib                      1.2.8                         3    defaults

Historical note: When I originally wrote this article, I obtained the following outputs at various times:

# packages in environment at /data/apps/anaconda:
#
cffi                      1.9.1                    py27_0    defaults
conda                     4.3.7                    py27_0    defaults
conda-env                 2.6.0                         0    defaults
cryptography              1.7.1                    py27_0    defaults
enum34                    1.1.6                    py27_0    defaults
idna                      2.2                      py27_0    defaults
ipaddress                 1.0.18                   py27_0    defaults
openssl                   1.0.2j                        0    defaults
pip                       9.0.1                    py27_1    defaults
pyasn1                    0.1.9                    py27_0    defaults
pycosat                   0.6.1                    py27_1    defaults
pycparser                 2.17                     py27_0    defaults
pycrypto                  2.6.1                    py27_4    defaults
pyopenssl                 16.2.0                   py27_0    defaults
python                    2.7.13                        0    defaults
readline                  6.2                           2    defaults
requests                  2.12.4                   py27_0    defaults
ruamel_yaml               0.11.14                  py27_1    defaults
setuptools                27.2.0                   py27_0    defaults
six                       1.10.0                   py27_0    defaults
sqlite                    3.13.0                        0    defaults
tk                        8.5.18                        0    defaults
wheel                     0.29.0                   py27_0    defaults
yaml                      0.1.6                         0    defaults
zlib                      1.2.8                         3    defaults
# packages in environment at /data/apps/anaconda:
#
conda                     4.2.7                    py27_0    defaults
conda-env                 2.6.0                         0    defaults
enum34                    1.1.6                    py27_0    defaults
openssl                   1.0.2i                        0    defaults
pip                       8.1.2                    py27_0    defaults
pycosat                   0.6.1                    py27_1    defaults
python                    2.7.12                        1    defaults
pyyaml                    3.12                     py27_0    defaults
readline                  6.2                           2    defaults
requests                  2.11.1                   py27_0    defaults
ruamel_yaml               0.11.14                  py27_0    defaults
setuptools                27.2.0                   py27_0    defaults
sqlite                    3.13.0                        0    defaults
tk                        8.5.18                        0    defaults
wheel                     0.29.0                   py27_0    defaults
yaml                      0.1.6                         0    defaults
zlib                      1.2.8                         3    defaults
# packages in environment at /data/apps/anaconda:
#
conda                     3.12.0                   py27_0  
conda-env                 2.1.4                    py27_0  
openssl                   1.0.1k                        1  
pip                       6.1.1                    py27_0  
pycosat                   0.6.1                    py27_0  
python                    2.7.9                         1  
pyyaml                    3.11                     py27_0  
readline                  6.2                           2  
requests                  2.7.0                    py27_0  
setuptools                15.2                     py27_0  
sqlite                    3.8.4.1                       1  
tk                        8.5.18                        0  
yaml                      0.1.4                         1  
zlib                      1.2.8                         0

One interesting feature shown here is that conda keeps track of your revisions. You can update the revisions with conda install --revision=0 (the original miniconda installation for example) and you can list them with:

In [2]:
%%bash
. deactivate 2> /dev/null
echo $PATH
conda list --revisions
/data/apps/anaconda/bin:/Users/mforbes/work/configurations/scripts:/data/apps/node/bin/:/Applications/git-annex.app/Contents/MacOS:/usr/local/cuda/bin:/Users/mforbes/usr/local/bin/:/usr/local/bin/:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/Users/mforbes/usr/local/bin/scripts:/Users/mforbes/usr/local/x86_64/bin:/Users/mforbes/usr/local/bin:/usr/local/bin:/opt/X11/bin:/usr/local/MacGPG2/bin:/usr/texbin:/opt/local/bin/:/Users/mforbes/bin/FDK/Tools/osx:/data/apps/anaconda/bin/./
2015-05-13 23:16:42  (rev 0)
    +conda-3.12.0
    +conda-env-2.1.4
    +openssl-1.0.1k
    +pycosat-0.6.1
    +python-2.7.9
    +pyyaml-3.11
    +requests-2.7.0

2015-05-13 23:27:27  (rev 1)
    +pip-6.1.1
    +readline-6.2
    +setuptools-15.2
    +sqlite-3.8.4.1
    +tk-8.5.18
    +yaml-0.1.4
    +zlib-1.2.8

2015-05-13 23:27:27  (rev 2)
    -pip-6.1.1
    -readline-6.2
    -setuptools-15.2
    -sqlite-3.8.4.1
    -tk-8.5.18
    -yaml-0.1.4
    -zlib-1.2.8

2015-05-13 23:27:31  (rev 3)
    +pip-6.1.1
    +readline-6.2
    +setuptools-15.2
    +sqlite-3.8.4.1
    +tk-8.5.18
    +yaml-0.1.4
    +zlib-1.2.8

Command Completion

Before doing any more work, add command completion so that you can explore options:

In [2]:
%%bash
. deactivate 2> /dev/null
conda install -y argcomplete
eval "$(register-python-argcomplete conda)"
Unsetting IPYTHONDIR
Unsetting TALENT2015DIR
Fetching package metadata .......
Solving package specifications: ..........

Package plan for installation in environment /data/apps/anaconda:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    argcomplete-1.0.0          |           py27_1          32 KB  defaults

The following NEW packages will be INSTALLED:

    argcomplete: 1.0.0-py27_1 defaults

Fetching packages ...
argcomplete-1. 100% |###############################| Time: 0:00:00 405.57 kB/s
Extracting packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################| 100%

Configure Conda

Conda allows you to configure it with the conda config command. Here I add the [conda-forge][] channel.

In [4]:
%%bash
. deactivate 2> /dev/null
conda config --append channels conda-forge
Unsetting IPYTHONDIR
Unsetting TALENT2015DIR
Warning: 'conda-forge' already in 'channels' list, moving to the bottom
In [5]:
%%bash
. deactivate 2> /dev/null
conda config --show
Unsetting IPYTHONDIR
Unsetting TALENT2015DIR
add_anaconda_token: True
add_pip_as_python_dependency: True
allow_softlinks: True
always_copy: False
always_softlink: False
always_yes: False
auto_update_conda: True
binstar_upload: None
changeps1: True
channel_alias: https://conda.anaconda.org
channel_priority: True
channels:
  - defaults
  - pypi
  - conda-forge
client_ssl_cert: 
client_ssl_cert_key: 
create_default_packages: []
debug: False
default_channels:
  - https://repo.continuum.io/pkgs/free
  - https://repo.continuum.io/pkgs/r
  - https://repo.continuum.io/pkgs/pro
disallow: []
envs_dirs:
  - /data/apps/anaconda/envs
json: False
offline: False
proxy_servers: {}
quiet: False
shortcuts: True
show_channel_urls: True
ssl_verify: True
track_features: []
update_dependencies: True
use_pip: True
verbosity: 0

Environments

To ensure reproducible computing, I highly recommend working from a clean environment for your projects so that you can enter a clean environment with

conda activate _conda_env

To do this, maintain an environment.yml file such as this:

# environment.yml
name: _conda_env
channels:
  - defaults
  - conda-forge
  - ioam
dependencies:
  - ipykernel        # Use with nb_conda_kernels so jupyter sees this kernel
  - numpy
  - scipy>=0.17.1
  - matplotlib>=1.5
  - uncertainties
  - ipywidgets
  - holoviews
  - pip:
    - mmf_setup>=0.1.11

Then create a new environment as follows:

conda env create -p _conda_env -f environment.yml

Periodically you should check if anything is outdated:

conda search -p _conda_env --outdated

and possibly update everything

conda update -p _conda_env --all

If you then make a _conda_env environment in the project and choose this as the kernel for your notebooks, you can then run in an isolated environment. Don't forget to exclude _cond_env from selective sync with Dropbox etc. as it can get big! For this reason, it can be better to install this globally.

Anaconda

For my work environment, I like to have everything in the anaconda meta-package, but this precludes me pinning python to a preferred version. For example - the following gives an error:

# environment.tst.yml
name: tst
channels:
  - defaults
  - conda-forge
dependencies:
  - python == 3.8.6   # Try >= 3.8.5
  - anaconda  # Gets most things: we usually want to depend on this.

Conda fails to built this, while Mamba builds a version that breaks on OS X:

mamba env create -f environment.tst.yml
conda activate -n tst && python -c "import scipy"

Being less restrictive works.

Frozen Environments

I manually create environment files like the one above which specify the leave nodes I need. To prune these, see the section Visualizing Dependencies:Conda

I keep a few clean environments for use when testing. I make these as another user (admin) so that I can't accidentally modify the environments.

In [ ]:
%%bash
. deactivate 2> /dev/null
conda update conda
envdir="$(conda info | grep 'envs directories' | awk 'NF>1{print $NF}')"

for p in 2.7 3.5 3.6 3.7 3.8 3.9; do
  env=py${p}
  echo conda env remove -y -n ${env} 2> /dev/null
  echo conda create -y -c defaults --override-channels --no-default-packages -n "${env}" python=${p}
  echo sudo chown admin "${envdir}/${env}"
  echo ln -s "${envdir}/${env}/bin/python${p}" ~/.local/bin/
done
conda clean --all -y

# This takes about 600MB

for p in 2.7 3.5 3.6 3.7 3.8 3.9; do
  env=py${p}a
  conda env remove -y -n ${env} 2> /dev/null
  conda create -y -n ${env} python=${p} anaconda
done

# This take more tha 8GB... I gave up.

If I want to test against a clean environment, I make a clone:

In [25]:
%%bash
conda create -m -p _envs/py2.6 --clone py2.6
. activate _envs/py2.6
. deactivate
rm -rf _envs
src_prefix: '/data/apps/anaconda/1.3.1/envs/py2.6'
dst_prefix: '/Users/mforbes/current/blog/Nikola/mmfblog/posts/_envs/py2.6'
Packages: 8
Files: 0
Fetching package metadata: ..........
Linking packages ...
[      COMPLETE      ]|##################################################| 100%
#
# To activate this environment, use:
# $ source activate /Users/mforbes/current/blog/Nikola/mmfblog/posts/_envs/py2.6
#
# To deactivate this environment, use:
# $ source deactivate
#
discarding /data/apps/anaconda/1.3.1/bin from PATH
prepending /Users/mforbes/current/blog/Nikola/mmfblog/posts/_envs/py2.6/bin to PATH
discarding /Users/mforbes/current/blog/Nikola/mmfblog/posts/_envs/py2.6/bin from PATH

Copying Environments

Conda environments are not relocatable. Even though everything lives in a single folder, moving that is asking for trouble. Here are some strategies:

conda-pack

BROKEN: When I tried this, SciPy failed:

In [1]: import scipy
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/data/apps/conda/envs/work_/lib/python3.8/site-packages/numpy/core/__init__.py in <module>
     21 try:
---> 22     from . import multiarray
     23 except ImportError as exc:

/data/apps/conda/envs/work_/lib/python3.8/site-packages/numpy/core/multiarray.py in <module>
     11 
---> 12 from . import overrides
     13 from . import _multiarray_umath

/data/apps/conda/envs/work_/lib/python3.8/site-packages/numpy/core/overrides.py in <module>
      6 
----> 7 from numpy.core._multiarray_umath import (
      8     add_docstring, implement_array_function, _get_implementing_args)

ImportError: dlopen(/data/apps/conda/envs/work_/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so, 2): Library not loaded: @rpath/libopenblas.dylib
  Referenced from: /data/apps/conda/envs/work_/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so
  Reason: image not found

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-1-4363d2be0702> in <module>
----> 1 import scipy

/data/apps/conda/envs/work_/lib/python3.8/site-packages/scipy/__init__.py in <module>
     59 __all__ = ['test']
     60 
---> 61 from numpy import show_config as show_numpy_config
     62 if show_numpy_config is None:
     63     raise ImportError(

/data/apps/conda/envs/work_/lib/python3.8/site-packages/numpy/__init__.py in <module>
    138     from . import _distributor_init
    139 
--> 140     from . import core
    141     from .core import *
    142     from . import compat

/data/apps/conda/envs/work_/lib/python3.8/site-packages/numpy/core/__init__.py in <module>
     46 """ % (sys.version_info[0], sys.version_info[1], sys.executable,
     47         __version__, exc)
---> 48     raise ImportError(msg)
     49 finally:
     50     for envkey in env_added:

ImportError: 

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

    https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

  * The Python version is: Python3.8 from "/data/apps/conda/envs/work_/bin/python"
  * The NumPy version is: "1.19.2"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: dlopen(/data/apps/conda/envs/work_/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so, 2): Library not loaded: @rpath/libopenblas.dylib
  Referenced from: /data/apps/conda/envs/work_/lib/python3.8/site-packages/numpy/core/_multiarray_umath.cpython-38-darwin.so
  Reason: image not found

Allows you to copy the environment. Install with conda install -c conda-forge conda-pack.

env=work                     # Specify the name here
new_penv=new_env_folder  # It will go here
conda pack -n "${env}" -o "${env}.tgz"
mkdir "${new_penv}"
tar -zxvf "$env.tgz" -C "${new_penv}"
conda activate "${new_penv}"
conda-unpack

Caveats:

  • Packages installed with pip -e in source mode cannot be copied. Install these properly or remove with pip uninstall.
  • Fails on Mac OS X with python.app and some other packages:

    Files managed by conda were found to have been deleted/overwritten in the following packages:

    • olefile='0.46'
    • defusedxml='0.6.0'
    • python.app='1.3'

    This is usually due to pip uninstalling or clobbering conda managed files, resulting in an inconsistent environment. Please check your environment for conda/pip conflicts using conda list, and fix the environment by ensuring only one version of each package is installed (conda preferred).

    In principle, this should be fixed by forcing these to be reinstalled:

    mamba install -n "${env}" --force-reinstall olefile defusedxml python.app
    

    but this does not fix python.app. For this, uninstall, pack, move, then reinstall:

    #mamba uninstall --force -n "${env}" python.app
    #Fails: see https://github.com/mamba-org/mamba/issues/412
    conda uninstall --force -n "${env}" python.app
    ...
    mamba install -p "${new_penv}" python.app
    
Spec-file
conda list --explicit > spec_file.txt

Jupyter

I install Jupyter into it's own environment and then use the following alias to launch it. This allows me to launch it in any environment without having to install it. To use those environments as their own kernel, make sure you include the ipykernel package in the environment and then the nb_conda package in the jupyter environment.

conda env create --file environment.jupyter.yml

Sometimes I have difficulty getting extensions working. The following may help:

jupyter serverextension enable --sys-prefix jupyter_nbextensions_configurator nb_conda
jupyter nbextension enable --sys-prefix toc2/main init_cell/main
jupyter serverextension disable --sys-prefix nbpresent
jupyter nbextension disable --sys-prefix nbpresent/js/nbpresent.min
# environment.jupyter.yml
name: jupyter
description: |
  Environment for running Jupyter, Jupyter notebooks, Jupyter Lab
  etc. This environment includes the following packages:

  * `nb_conda`: This enables Jupyter to local conda-installed
    environments.  To use this, make sure you install the `ipykernel`
    package in your conda environments.
  * `jupytext`: Allows you to store Jupyter notebooks as text files
    (.py) for better version control.  To enable this for a notebook,
    you can run:

        jupytext --set-formats ipynb,py --sync notebook.ipynb

  * `rise`: Allows you to use your notebooks for presentations.
channels:
  - defaults
  - conda-forge
dependencies:
  - python=3
  - nb_conda
  - jupyter_contrib_nbextensions
  - jupyter_nbextensions_configurator
  - ipyparallel
  - nbbrowserpdf
  - nbdime
  - nbstripout
  - jupyterlab
  - nbdime
  - rise
  - jupytext

  # VisPy
  #- ipywidgets
  #- vispy
  #- npm
  #- pip
  #- pip:
  #  - git+git@github.com:vispy/vispy.git#egg=vispy


  # matplotlib
  #- ipympl


  # jupyter nbextension enable --py widgetsnbextension
  # jupyter nbextension enable --py vispy
# ~/.environment_site which is sourced by ~/.bashrc
...

# New way of activating conda: Use your install location
. /data/apps/anaconda/etc/profile.d/conda.sh
conda activate          # Optional - activates the base environment.

function j { 
    if [ -f './jupyter_notebook_config.py' ]; then
        CONFIG_FLAG="--config=./jupyter_notebook_config.py";
    else
        if [ -f "$(hg root)/jupyter_notebook_config.py" ]; then
            CONFIG_FLAG="--config=$(hg root)/jupyter_notebook_config.py";
        else
            CONFIG_FLAG="";
        fi;
    fi;
    echo "conda activate jupyter";
    conda activate jupyter;
    echo "jupyter notebook ${CONFIG_FLAG} $*";
    #unset BASH_ENV module ml;
    jupyter notebook "${CONFIG_FLAG}" "$*";
    conda deactivate
}

Configuration

To see where Jupyter configuration files go, run

In [9]:
%%bash
. activate jupyter
jupyter --paths
config:
    /Users/mforbes/.jupyter
    /data/apps/anaconda/envs/jupyter/etc/jupyter
    /usr/local/etc/jupyter
    /etc/jupyter
data:
    /Users/mforbes/Library/Jupyter
    /data/apps/anaconda/envs/jupyter/share/jupyter
    /usr/local/share/jupyter
    /usr/share/jupyter
runtime:
    /Users/mforbes/Library/Jupyter/runtime

I add the following kernel so I can seamlessly match with [CoCalc][].

# ~/Library/Jupyter/kernels/python2-ubuntu/kernel.json
{
 "display_name": "Python 2 (Ubuntu, plain)",
 "argv": [
  "/data/apps/anaconda/envs/work/bin/python",
  "-m",
  "ipykernel",
  "-f",
  "{connection_file}"
 ],
 "language": "python"
}

Anaconda Cloud

Once you have useful environments, you can push them to Anaconda Cloud so that you or others can use them:

anaconda login    # If you have not logged in.
anaconda upload environment.work.yml

Once this is done, you can install the environment with one of:

conda env create mforbes/work   
mamba env create mforbes/work   # Faster, but experimental

Clean

The Conda package cache can help speed the creation of new environments, but can take up quite a bit of disk space. One can reclaim this with conda clean:

In [20]:
!conda clean -p --dry-run
!conda clean -p -y
Cache location: /data/apps/anaconda/1.3.1/pkgs
Will remove the following packages:

_license-1.1-py27_0                          231 KB
accelerate-1.0.1-np17py27_p0                   9 KB
accelerate-1.5.1-np18py27_p0                   9 KB
anaconda-2.1.0-np19py27_0                     11 KB
anaconda-2.2.0-np19py26_0                     10 KB
anaconda-2.2.0-np19py27_0                     11 KB
argcomplete-0.8.1-py27_0                     103 KB
astropy-0.2.3-np17py27_0                    12.9 MB
astropy-0.2.5-np17py33_0                    13.6 MB
astropy-0.3.2-np18py27_0                    19.7 MB
atom-0.2.3-py27_0                            350 KB
beautiful-soup-4.3.1-py33_0                  658 KB
binstar-0.1.1-py27_0                         142 KB
binstar-0.5.3-py27_0                         342 KB
biopython-1.61-np17py27_0                   10.4 MB
bitarray-0.8.1-py33_0                        266 KB
blaze-0.5.0-np18py27_1                       1.3 MB
blz-0.6.2-np18py27_0                         1.4 MB
bokeh-0.4.4-np18py27_1                      24.9 MB
boto-2.28.0-py27_0                           8.0 MB
boto-2.9.6-py27_0                            6.2 MB
cdecimal-2.3-py26_0                          462 KB
cdecimal-2.3-py27_0                          462 KB
cffi-0.8-py27_0                              479 KB
chaco-4.2.1.dev-np17py27_0                  21.2 MB
colorama-0.2.7-py33_0                         59 KB
conda-3.5.5-py27_0                           604 KB
conda-3.7.0-py27_0                           701 KB
conda-3.7.1-py27_0                           705 KB
conda-3.7.3-py27_0                           710 KB
conda-3.7.4-py27_0                           727 KB
conda-3.8.3-py27_0                           739 KB
conda-3.8.4-py27_0                           743 KB
conda-3.9.1-py27_0                           748 KB
conda-env-2.0.1-py27_0                        58 KB
conda-env-2.1.0-py27_0                        57 KB
conda-env-2.1.2-py27_0                        58 KB
conda-env-2.1.3-py27_0                        58 KB
configobj-5.0.6-py26_0                       255 KB
configobj-5.0.6-py27_0                       254 KB
cubes-0.10.2-py27_2                          636 KB
cudatoolkit-6.0-p0                         228.2 MB
curl-7.30.0-0                                1.7 MB
cython-0.19.1-py27_0                         8.0 MB
cython-0.19.2-py33_0                         9.0 MB
cython-0.20.1-py27_0                         9.0 MB
datashape-0.2.0-np18py27_1                   404 KB
dateutil-2.1-py27_1                          334 KB
dateutil-2.1-py33_2                          358 KB
decorator-3.4.0-py26_0                        24 KB
decorator-3.4.0-py27_0                        23 KB
distribute-0.6.45-py27_0                     1.8 MB
distribute-0.6.45-py33_0                     1.9 MB
docutils-0.10-py27_0                         3.1 MB
docutils-0.11-py33_0                         3.5 MB
dulwich-0.9.7-py27_0                         2.3 MB
dynd-python-0.3.0-np17py27_0                 846 KB
dynd-python-0.5.0-np17py33_0                 959 KB
dynd-python-0.6.2-np18py27_0                 1.4 MB
enable-4.3.0-np18py27_2                      6.8 MB
enaml-0.7.6-py27_0                           5.7 MB
enaml-0.9.1-py27_1                           6.9 MB
flake8-2.1.0-py27_0                           60 KB
flake8-2.3.0-py27_0                           93 KB
flask-0.10.1-py27_0                          818 KB
flask-0.10.1-py33_1                          943 KB
future-0.12.1-py27_0                         4.1 MB
gdata-2.0.17-py27_0                          5.1 MB
gevent-0.13.8-py27_0                         807 KB
gevent-websocket-0.3.6-py27_2                 51 KB
gevent_zeromq-0.2.5-py27_2                   136 KB
greenlet-0.4.1-py27_0                         37 KB
greenlet-0.4.1-py33_0                         37 KB
h5py-2.1.1-np17py27_0                        4.8 MB
h5py-2.3.0-np18py27_0                        3.4 MB
hdf5-1.8.13-0                                5.2 MB
hdf5-1.8.9-0                                 5.1 MB
hdf5-1.8.9-1                                 5.1 MB
ipython-1.1.0-py27_0                        13.2 MB
ipython-1.1.0-py33_0                        14.2 MB
ipython-2.2.0-py27_1                        12.5 MB
ipython-2.3.0-py27_0                        12.5 MB
ipython-2.3.1-py27_0                        12.5 MB
ipython-notebook-0.13.2-py27_0                974 B
ipython-notebook-2.2.0-py27_0                  5 KB
ipython-notebook-2.3.1-py27_0                  5 KB
ipython-qtconsole-2.2.0-py27_0                 4 KB
ipython-qtconsole-3.0.0-py27_0                 4 KB
itsdangerous-0.23-py33_0                      74 KB
itsdangerous-0.24-py26_0                      68 KB
itsdangerous-0.24-py27_0                      68 KB
jdcal-1.0-py26_0                              37 KB
jdcal-1.0-py27_0                              36 KB
jinja2-2.6-py27_0                            1.6 MB
jinja2-2.7.1-py33_0                          1.8 MB
keyring-1.4-py27_0                           364 KB
kiwisolver-0.1.3-py27_0                      195 KB
launcher-0.1.1-py27_0                        3.3 MB
launcher-0.1.2-py27_1                        2.8 MB
launcher-0.1.5-py27_0                        2.8 MB
libdynd-0.3.0-0                              3.0 MB
libdynd-0.5.0-0                              9.9 MB
libdynd-0.6.2-0                             13.3 MB
libevent-2.0.20-0                            2.0 MB
libnetcdf-4.2.1.1-1                          3.4 MB
libxslt-1.1.28-1                             2.7 MB
llvm-3.2-0                                  50.3 MB
llvmmath-0.1.0-np17py27_0                    359 KB
llvmmath-0.1.1-np17py33_2                    415 KB
llvmpy-0.11.3-py27_0                         2.6 MB
llvmpy-0.12.0-py33_0                         3.0 MB
llvmpy-0.12.6-py27_0                         2.9 MB
lxml-3.2.1-py27_0                            3.2 MB
lxml-3.2.3-py33_0                            3.1 MB
lxml-3.3.5-py27_0                            3.4 MB
lxml-3.4.0-py27_0                            3.5 MB
mako-0.8.0-py27_0                            613 KB
markupsafe-0.18-py33_0                        76 KB
matplotlib-1.2.1-np17py27_1                 53.5 MB
matplotlib-1.3.1-np17py33_0                 59.3 MB
matplotlib-1.3.1-np18py27_1                 58.1 MB
matplotlib-1.4.0-np19py27_0                 70.5 MB
mccabe-0.2.1-py27_1                           28 KB
mccabe-0.3-py27_1                             28 KB
mdp-3.3-np17py27_0                           2.8 MB
mdp-3.3-np17py33_0                           3.1 MB
mercurial-3.0-py27_0                         6.4 MB
mistune-0.5.1-py26_0                          84 KB
mistune-0.5.1-py27_0                          84 KB
mkl-11.1-np18py27_p2                           9 KB
mock-1.0.1-py26_0                            156 KB
mock-1.0.1-py27_0                            155 KB
multipledispatch-0.4.3-py27_0                 36 KB
netcdf4-1.0.6-np17py33_0                     1.2 MB
networkx-1.7-py27_0                          4.1 MB
networkx-1.8.1-py33_0                        4.7 MB
nltk-2.0.4-np17py27_0                        7.3 MB
nose-1.3.0-py33_0                            1.0 MB
nose-1.3.3-py27_0                            958 KB
nose-1.3.4-py27_0                            958 KB
numba-0.11.0-np17py33_0                      6.0 MB
numba-0.13.2-np18py27_0                      2.7 MB
numba-0.9.0-np17py27_0                       4.6 MB
numbapro-0.10.1-np17py27_p0                  1.2 MB
numbapro-0.14.1-np18py27_p0                  1.3 MB
numbapro_cudalib-0.1-0                       6.0 MB
numexpr-2.0.1-np17py27_3                     478 KB
numexpr-2.2.2-np17py33_0                     525 KB
numexpr-2.3.1-np18py27_p0                    433 KB
numpy-1.7.1-py27_0                          14.1 MB
numpy-1.7.1-py33_0                          12.7 MB
numpy-1.8.1-py27_p0                         14.5 MB
numpy-1.9.0-py27_p0                         14.4 MB
openpyxl-1.6.2-py33_0                        625 KB
openssl-1.0.1c-0                             7.9 MB
openssl-1.0.1h-0                             8.0 MB
openssl-1.0.1h-1                             8.6 MB
openssl-1.0.1j-4                             8.9 MB
openssl-1.0.1k-0                             9.0 MB
ordereddict-1.1-py26_0                        10 KB
pandas-0.11.0-np17py27_1                    14.3 MB
pandas-0.12.0-np17py33_0                    17.1 MB
pandas-0.14.0-np18py27_0                    19.3 MB
pandas-0.14.1-np19py27_0                    21.9 MB
patsy-0.2.1-np17py33_0                       1.1 MB
pep8-1.5.7-py27_0                            166 KB
pep8-1.6.2-py26_0                            182 KB
pep8-1.6.2-py27_0                            181 KB
pillow-2.1.0-py33_0                          1.6 MB
pip-1.3.1-py27_2                             849 KB
pip-1.4.1-py33_0                             3.0 MB
pip-1.5.6-py27_0                             5.2 MB
pip-6.0.6-py27_0                             6.1 MB
pip-6.0.8-py34_0                             5.7 MB
pip-coverage-2.7-0.0-py27_0                  523 KB
pip-ipdb-0.8-0.0-py27_0                       21 KB
ply-3.4-py33_0                               342 KB
psutil-0.7.1-py27_0                          355 KB
psutil-1.1.2-py33_0                          453 KB
py-1.4.14-py27_0                             565 KB
pyaudio-0.2.7-py27_0                         201 KB
pycosat-0.6.0-py33_0                         156 KB
pycosat-0.6.1-py26_0                         160 KB
pycosat-0.6.1-py27_0                         160 KB
pycparser-2.9.1-py27_0                       811 KB
pycparser-2.9.1-py33_0                       879 KB
pycrypto-2.6-py27_0                          1.9 MB
pycrypto-2.6.1-py33_0                        2.0 MB
pycurl-7.19.3.1-py27_2                       104 KB
pyflakes-0.7.2-py27_0                        292 KB
pyflakes-0.7.3-py33_0                        334 KB
pygments-1.6-py33_0                          4.1 MB
pyparsing-1.5.6-py33_0                       344 KB
pyparsing-2.0.3-py26_0                       321 KB
pyparsing-2.0.3-py27_0                       320 KB
pysal-1.5.0-np17py27_1                      11.1 MB
pytables-2.4.0-np17py27_0                    6.8 MB
pytables-3.0.0-np17py33_1                    8.0 MB
pytables-3.1.1-np18py27_0                    7.9 MB
pytest-2.3.5-py27_0                          772 KB
python-2.7.5-1                              45.4 MB
python-2.7.8-0                              46.9 MB
python-2.7.8-1                              46.9 MB
python.app-1.2-py27_0                         18 KB
python.app-1.2-py27_2                         18 KB
pytz-2013b-py33_0                            987 KB
pytz-2014.3-py27_0                           888 KB
pytz-2014.7-py27_0                           907 KB
pyyaml-3.10-py33_0                           675 KB
pyzmq-14.3.0-py27_0                          1.3 MB
pyzmq-14.3.1-py27_0                          1.3 MB
pyzmq-2.2.0.1-py33_1                         1.1 MB
readline-6.2-1                               1.2 MB
redis-py-2.7.2-py27_0                        214 KB
requests-1.2.3-py27_0                        1.7 MB
requests-1.2.3-py33_0                        1.8 MB
requests-2.3.0-py27_0                        2.0 MB
requests-2.4.1-py27_0                        2.0 MB
requests-2.4.3-py27_0                        2.0 MB
requests-2.5.0-py27_0                        2.0 MB
requests-2.5.1-py27_0                        2.0 MB
requests-2.5.3-py27_0                        2.0 MB
runipy-0.1.1-py27_0                           11 KB
scikit-image-0.10.0-np18py27_0              23.7 MB
scikit-image-0.8.2-np17py27_1                8.8 MB
scikit-image-0.9.3-np17py33_0               14.9 MB
scikit-learn-0.13.1-np17py27_0               9.0 MB
scikit-learn-0.14.1-np18py27_p1             10.4 MB
scikits.bvp1lg-0.2.5-py27_0                  603 KB
scipy-0.12.0-np17py27_0                     38.1 MB
scipy-0.13.0-np17py33_0                     36.3 MB
scipy-0.14.0-np18py27_p0                    40.8 MB
scipy-0.14.0-np19py27_p0                    41.1 MB
setuptools-11.3.1-py27_0                     443 KB
setuptools-12.0.5-py27_0                     449 KB
setuptools-12.2-py27_0                       449 KB
setuptools-13.0.2-py27_0                     448 KB
setuptools-14.0-py26_0                       451 KB
setuptools-14.0-py27_0                       448 KB
setuptools-14.0-py34_0                       456 KB
setuptools-14.3-py26_0                       451 KB
setuptools-14.3-py27_0                       448 KB
setuptools-15.0-py26_0                       451 KB
setuptools-15.0-py27_0                       449 KB
setuptools-5.8-py27_0                        435 KB
setuptools-7.0-py27_0                        447 KB
share-eb21bd2b7a9bf800dab463134d15f4404983d5fe-0    78.1 MB
six-1.4.1-py33_0                              47 KB
six-1.8.0-py27_0                              63 KB
six-1.9.0-py26_0                              62 KB
six-1.9.0-py27_0                              62 KB
sphinx-1.1.3-py27_3                          3.6 MB
sphinx-1.1.3-py33_4                          3.9 MB
sphinx-1.2.2-py27_0                          4.2 MB
spyder-2.2.0-py27_1                          8.5 MB
spyder-2.3.0rc1-py27_0                       8.9 MB
spyder-app-2.3.1-py27_0                        7 KB
spyder-app-2.3.4-py27_0                        7 KB
sqlalchemy-0.8.1-py27_0                      6.1 MB
sqlalchemy-0.8.3-py33_0                      6.9 MB
sqlalchemy-0.9.4-py27_0                      6.8 MB
sqlite-3.8.4.1-0                             2.5 MB
statsmodels-0.4.3-np17py27_1                15.7 MB
statsmodels-0.5.0-np17py33_0                26.1 MB
sympy-0.7.3-py33_0                          28.7 MB
tk-8.5.15-0                                  6.6 MB
tornado-3.1-py27_0                           2.2 MB
tornado-3.1.1-py33_0                         2.6 MB
tornado-3.2.1-py27_0                         2.4 MB
ujson-1.33-py26_0                             62 KB
ujson-1.33-py27_0                             62 KB
werkzeug-0.9.1-py27_0                        2.0 MB
werkzeug-0.9.4-py33_0                        2.2 MB
werkzeug-0.9.6-py27_0                        2.0 MB
xlrd-0.9.2-py33_0                            848 KB
xlsxwriter-0.5.5-py27_0                      998 KB
xz-5.0.5-0                                   621 KB
zope.interface-4.0.5-py27_0                  1.3 MB
------------------------------------------------------------
Total:                                      1.76 GB

Dry run: exiting
Cache location: /data/apps/anaconda/1.3.1/pkgs
Will remove the following packages:

_license-1.1-py27_0                          231 KB
accelerate-1.0.1-np17py27_p0                   9 KB
accelerate-1.5.1-np18py27_p0                   9 KB
anaconda-2.1.0-np19py27_0                     11 KB
anaconda-2.2.0-np19py26_0                     10 KB
anaconda-2.2.0-np19py27_0                     11 KB
argcomplete-0.8.1-py27_0                     103 KB
astropy-0.2.3-np17py27_0                    12.9 MB
astropy-0.2.5-np17py33_0                    13.6 MB
astropy-0.3.2-np18py27_0                    19.7 MB
atom-0.2.3-py27_0                            350 KB
beautiful-soup-4.3.1-py33_0                  658 KB
binstar-0.1.1-py27_0                         142 KB
binstar-0.5.3-py27_0                         342 KB
biopython-1.61-np17py27_0                   10.4 MB
bitarray-0.8.1-py33_0                        266 KB
blaze-0.5.0-np18py27_1                       1.3 MB
blz-0.6.2-np18py27_0                         1.4 MB
bokeh-0.4.4-np18py27_1                      24.9 MB
boto-2.28.0-py27_0                           8.0 MB
boto-2.9.6-py27_0                            6.2 MB
cdecimal-2.3-py26_0                          462 KB
cdecimal-2.3-py27_0                          462 KB
cffi-0.8-py27_0                              479 KB
chaco-4.2.1.dev-np17py27_0                  21.2 MB
colorama-0.2.7-py33_0                         59 KB
conda-3.5.5-py27_0                           604 KB
conda-3.7.0-py27_0                           701 KB
conda-3.7.1-py27_0                           705 KB
conda-3.7.3-py27_0                           710 KB
conda-3.7.4-py27_0                           727 KB
conda-3.8.3-py27_0                           739 KB
conda-3.8.4-py27_0                           743 KB
conda-3.9.1-py27_0                           748 KB
conda-env-2.0.1-py27_0                        58 KB
conda-env-2.1.0-py27_0                        57 KB
conda-env-2.1.2-py27_0                        58 KB
conda-env-2.1.3-py27_0                        58 KB
configobj-5.0.6-py26_0                       255 KB
configobj-5.0.6-py27_0                       254 KB
cubes-0.10.2-py27_2                          636 KB
cudatoolkit-6.0-p0                         228.2 MB
curl-7.30.0-0                                1.7 MB
cython-0.19.1-py27_0                         8.0 MB
cython-0.19.2-py33_0                         9.0 MB
cython-0.20.1-py27_0                         9.0 MB
datashape-0.2.0-np18py27_1                   404 KB
dateutil-2.1-py27_1                          334 KB
dateutil-2.1-py33_2                          358 KB
decorator-3.4.0-py26_0                        24 KB
decorator-3.4.0-py27_0                        23 KB
distribute-0.6.45-py27_0                     1.8 MB
distribute-0.6.45-py33_0                     1.9 MB
docutils-0.10-py27_0                         3.1 MB
docutils-0.11-py33_0                         3.5 MB
dulwich-0.9.7-py27_0                         2.3 MB
dynd-python-0.3.0-np17py27_0                 846 KB
dynd-python-0.5.0-np17py33_0                 959 KB
dynd-python-0.6.2-np18py27_0                 1.4 MB
enable-4.3.0-np18py27_2                      6.8 MB
enaml-0.7.6-py27_0                           5.7 MB
enaml-0.9.1-py27_1                           6.9 MB
flake8-2.1.0-py27_0                           60 KB
flake8-2.3.0-py27_0                           93 KB
flask-0.10.1-py27_0                          818 KB
flask-0.10.1-py33_1                          943 KB
future-0.12.1-py27_0                         4.1 MB
gdata-2.0.17-py27_0                          5.1 MB
gevent-0.13.8-py27_0                         807 KB
gevent-websocket-0.3.6-py27_2                 51 KB
gevent_zeromq-0.2.5-py27_2                   136 KB
greenlet-0.4.1-py27_0                         37 KB
greenlet-0.4.1-py33_0                         37 KB
h5py-2.1.1-np17py27_0                        4.8 MB
h5py-2.3.0-np18py27_0                        3.4 MB
hdf5-1.8.13-0                                5.2 MB
hdf5-1.8.9-0                                 5.1 MB
hdf5-1.8.9-1                                 5.1 MB
ipython-1.1.0-py27_0                        13.2 MB
ipython-1.1.0-py33_0                        14.2 MB
ipython-2.2.0-py27_1                        12.5 MB
ipython-2.3.0-py27_0                        12.5 MB
ipython-2.3.1-py27_0                        12.5 MB
ipython-notebook-0.13.2-py27_0                974 B
ipython-notebook-2.2.0-py27_0                  5 KB
ipython-notebook-2.3.1-py27_0                  5 KB
ipython-qtconsole-2.2.0-py27_0                 4 KB
ipython-qtconsole-3.0.0-py27_0                 4 KB
itsdangerous-0.23-py33_0                      74 KB
itsdangerous-0.24-py26_0                      68 KB
itsdangerous-0.24-py27_0                      68 KB
jdcal-1.0-py26_0                              37 KB
jdcal-1.0-py27_0                              36 KB
jinja2-2.6-py27_0                            1.6 MB
jinja2-2.7.1-py33_0                          1.8 MB
keyring-1.4-py27_0                           364 KB
kiwisolver-0.1.3-py27_0                      195 KB
launcher-0.1.1-py27_0                        3.3 MB
launcher-0.1.2-py27_1                        2.8 MB
launcher-0.1.5-py27_0                        2.8 MB
libdynd-0.3.0-0                              3.0 MB
libdynd-0.5.0-0                              9.9 MB
libdynd-0.6.2-0                             13.3 MB
libevent-2.0.20-0                            2.0 MB
libnetcdf-4.2.1.1-1                          3.4 MB
libxslt-1.1.28-1                             2.7 MB
llvm-3.2-0                                  50.3 MB
llvmmath-0.1.0-np17py27_0                    359 KB
llvmmath-0.1.1-np17py33_2                    415 KB
llvmpy-0.11.3-py27_0                         2.6 MB
llvmpy-0.12.0-py33_0                         3.0 MB
llvmpy-0.12.6-py27_0                         2.9 MB
lxml-3.2.1-py27_0                            3.2 MB
lxml-3.2.3-py33_0                            3.1 MB
lxml-3.3.5-py27_0                            3.4 MB
lxml-3.4.0-py27_0                            3.5 MB
mako-0.8.0-py27_0                            613 KB
markupsafe-0.18-py33_0                        76 KB
matplotlib-1.2.1-np17py27_1                 53.5 MB
matplotlib-1.3.1-np17py33_0                 59.3 MB
matplotlib-1.3.1-np18py27_1                 58.1 MB
matplotlib-1.4.0-np19py27_0                 70.5 MB
mccabe-0.2.1-py27_1                           28 KB
mccabe-0.3-py27_1                             28 KB
mdp-3.3-np17py27_0                           2.8 MB
mdp-3.3-np17py33_0                           3.1 MB
mercurial-3.0-py27_0                         6.4 MB
mistune-0.5.1-py26_0                          84 KB
mistune-0.5.1-py27_0                          84 KB
mkl-11.1-np18py27_p2                           9 KB
mock-1.0.1-py26_0                            156 KB
mock-1.0.1-py27_0                            155 KB
multipledispatch-0.4.3-py27_0                 36 KB
netcdf4-1.0.6-np17py33_0                     1.2 MB
networkx-1.7-py27_0                          4.1 MB
networkx-1.8.1-py33_0                        4.7 MB
nltk-2.0.4-np17py27_0                        7.3 MB
nose-1.3.0-py33_0                            1.0 MB
nose-1.3.3-py27_0                            958 KB
nose-1.3.4-py27_0                            958 KB
numba-0.11.0-np17py33_0                      6.0 MB
numba-0.13.2-np18py27_0                      2.7 MB
numba-0.9.0-np17py27_0                       4.6 MB
numbapro-0.10.1-np17py27_p0                  1.2 MB
numbapro-0.14.1-np18py27_p0                  1.3 MB
numbapro_cudalib-0.1-0                       6.0 MB
numexpr-2.0.1-np17py27_3                     478 KB
numexpr-2.2.2-np17py33_0                     525 KB
numexpr-2.3.1-np18py27_p0                    433 KB
numpy-1.7.1-py27_0                          14.1 MB
numpy-1.7.1-py33_0                          12.7 MB
numpy-1.8.1-py27_p0                         14.5 MB
numpy-1.9.0-py27_p0                         14.4 MB
openpyxl-1.6.2-py33_0                        625 KB
openssl-1.0.1c-0                             7.9 MB
openssl-1.0.1h-0                             8.0 MB
openssl-1.0.1h-1                             8.6 MB
openssl-1.0.1j-4                             8.9 MB
openssl-1.0.1k-0                             9.0 MB
ordereddict-1.1-py26_0                        10 KB
pandas-0.11.0-np17py27_1                    14.3 MB
pandas-0.12.0-np17py33_0                    17.1 MB
pandas-0.14.0-np18py27_0                    19.3 MB
pandas-0.14.1-np19py27_0                    21.9 MB
patsy-0.2.1-np17py33_0                       1.1 MB
pep8-1.5.7-py27_0                            166 KB
pep8-1.6.2-py26_0                            182 KB
pep8-1.6.2-py27_0                            181 KB
pillow-2.1.0-py33_0                          1.6 MB
pip-1.3.1-py27_2                             849 KB
pip-1.4.1-py33_0                             3.0 MB
pip-1.5.6-py27_0                             5.2 MB
pip-6.0.6-py27_0                             6.1 MB
pip-6.0.8-py34_0                             5.7 MB
pip-coverage-2.7-0.0-py27_0                  523 KB
pip-ipdb-0.8-0.0-py27_0                       21 KB
ply-3.4-py33_0                               342 KB
psutil-0.7.1-py27_0                          355 KB
psutil-1.1.2-py33_0                          453 KB
py-1.4.14-py27_0                             565 KB
pyaudio-0.2.7-py27_0                         201 KB
pycosat-0.6.0-py33_0                         156 KB
pycosat-0.6.1-py26_0                         160 KB
pycosat-0.6.1-py27_0                         160 KB
pycparser-2.9.1-py27_0                       811 KB
pycparser-2.9.1-py33_0                       879 KB
pycrypto-2.6-py27_0                          1.9 MB
pycrypto-2.6.1-py33_0                        2.0 MB
pycurl-7.19.3.1-py27_2                       104 KB
pyflakes-0.7.2-py27_0                        292 KB
pyflakes-0.7.3-py33_0                        334 KB
pygments-1.6-py33_0                          4.1 MB
pyparsing-1.5.6-py33_0                       344 KB
pyparsing-2.0.3-py26_0                       321 KB
pyparsing-2.0.3-py27_0                       320 KB
pysal-1.5.0-np17py27_1                      11.1 MB
pytables-2.4.0-np17py27_0                    6.8 MB
pytables-3.0.0-np17py33_1                    8.0 MB
pytables-3.1.1-np18py27_0                    7.9 MB
pytest-2.3.5-py27_0                          772 KB
python-2.7.5-1                              45.4 MB
python-2.7.8-0                              46.9 MB
python-2.7.8-1                              46.9 MB
python.app-1.2-py27_0                         18 KB
python.app-1.2-py27_2                         18 KB
pytz-2013b-py33_0                            987 KB
pytz-2014.3-py27_0                           888 KB
pytz-2014.7-py27_0                           907 KB
pyyaml-3.10-py33_0                           675 KB
pyzmq-14.3.0-py27_0                          1.3 MB
pyzmq-14.3.1-py27_0                          1.3 MB
pyzmq-2.2.0.1-py33_1                         1.1 MB
readline-6.2-1                               1.2 MB
redis-py-2.7.2-py27_0                        214 KB
requests-1.2.3-py27_0                        1.7 MB
requests-1.2.3-py33_0                        1.8 MB
requests-2.3.0-py27_0                        2.0 MB
requests-2.4.1-py27_0                        2.0 MB
requests-2.4.3-py27_0                        2.0 MB
requests-2.5.0-py27_0                        2.0 MB
requests-2.5.1-py27_0                        2.0 MB
requests-2.5.3-py27_0                        2.0 MB
runipy-0.1.1-py27_0                           11 KB
scikit-image-0.10.0-np18py27_0              23.7 MB
scikit-image-0.8.2-np17py27_1                8.8 MB
scikit-image-0.9.3-np17py33_0               14.9 MB
scikit-learn-0.13.1-np17py27_0               9.0 MB
scikit-learn-0.14.1-np18py27_p1             10.4 MB
scikits.bvp1lg-0.2.5-py27_0                  603 KB
scipy-0.12.0-np17py27_0                     38.1 MB
scipy-0.13.0-np17py33_0                     36.3 MB
scipy-0.14.0-np18py27_p0                    40.8 MB
scipy-0.14.0-np19py27_p0                    41.1 MB
setuptools-11.3.1-py27_0                     443 KB
setuptools-12.0.5-py27_0                     449 KB
setuptools-12.2-py27_0                       449 KB
setuptools-13.0.2-py27_0                     448 KB
setuptools-14.0-py26_0                       451 KB
setuptools-14.0-py27_0                       448 KB
setuptools-14.0-py34_0                       456 KB
setuptools-14.3-py26_0                       451 KB
setuptools-14.3-py27_0                       448 KB
setuptools-15.0-py26_0                       451 KB
setuptools-15.0-py27_0                       449 KB
setuptools-5.8-py27_0                        435 KB
setuptools-7.0-py27_0                        447 KB
share-eb21bd2b7a9bf800dab463134d15f4404983d5fe-0    78.1 MB
six-1.4.1-py33_0                              47 KB
six-1.8.0-py27_0                              63 KB
six-1.9.0-py26_0                              62 KB
six-1.9.0-py27_0                              62 KB
sphinx-1.1.3-py27_3                          3.6 MB
sphinx-1.1.3-py33_4                          3.9 MB
sphinx-1.2.2-py27_0                          4.2 MB
spyder-2.2.0-py27_1                          8.5 MB
spyder-2.3.0rc1-py27_0                       8.9 MB
spyder-app-2.3.1-py27_0                        7 KB
spyder-app-2.3.4-py27_0                        7 KB
sqlalchemy-0.8.1-py27_0                      6.1 MB
sqlalchemy-0.8.3-py33_0                      6.9 MB
sqlalchemy-0.9.4-py27_0                      6.8 MB
sqlite-3.8.4.1-0                             2.5 MB
statsmodels-0.4.3-np17py27_1                15.7 MB
statsmodels-0.5.0-np17py33_0                26.1 MB
sympy-0.7.3-py33_0                          28.7 MB
tk-8.5.15-0                                  6.6 MB
tornado-3.1-py27_0                           2.2 MB
tornado-3.1.1-py33_0                         2.6 MB
tornado-3.2.1-py27_0                         2.4 MB
ujson-1.33-py26_0                             62 KB
ujson-1.33-py27_0                             62 KB
werkzeug-0.9.1-py27_0                        2.0 MB
werkzeug-0.9.4-py33_0                        2.2 MB
werkzeug-0.9.6-py27_0                        2.0 MB
xlrd-0.9.2-py33_0                            848 KB
xlsxwriter-0.5.5-py27_0                      998 KB
xz-5.0.5-0                                   621 KB
zope.interface-4.0.5-py27_0                  1.3 MB
------------------------------------------------------------
Total:                                      1.76 GB

removing _license-1.1-py27_0
removing accelerate-1.0.1-np17py27_p0
removing accelerate-1.5.1-np18py27_p0
removing anaconda-2.1.0-np19py27_0
removing anaconda-2.2.0-np19py26_0
removing anaconda-2.2.0-np19py27_0
removing argcomplete-0.8.1-py27_0
removing astropy-0.2.3-np17py27_0
removing astropy-0.2.5-np17py33_0
removing astropy-0.3.2-np18py27_0
removing atom-0.2.3-py27_0
removing beautiful-soup-4.3.1-py33_0
removing binstar-0.1.1-py27_0
removing binstar-0.5.3-py27_0
removing biopython-1.61-np17py27_0
removing bitarray-0.8.1-py33_0
removing blaze-0.5.0-np18py27_1
removing blz-0.6.2-np18py27_0
removing bokeh-0.4.4-np18py27_1
removing boto-2.28.0-py27_0
removing boto-2.9.6-py27_0
removing cdecimal-2.3-py26_0
removing cdecimal-2.3-py27_0
removing cffi-0.8-py27_0
removing chaco-4.2.1.dev-np17py27_0
removing colorama-0.2.7-py33_0
removing conda-3.5.5-py27_0
removing conda-3.7.0-py27_0
removing conda-3.7.1-py27_0
removing conda-3.7.3-py27_0
removing conda-3.7.4-py27_0
removing conda-3.8.3-py27_0
removing conda-3.8.4-py27_0
removing conda-3.9.1-py27_0
removing conda-env-2.0.1-py27_0
removing conda-env-2.1.0-py27_0
removing conda-env-2.1.2-py27_0
removing conda-env-2.1.3-py27_0
removing configobj-5.0.6-py26_0
removing configobj-5.0.6-py27_0
removing cubes-0.10.2-py27_2
removing cudatoolkit-6.0-p0
removing curl-7.30.0-0
removing cython-0.19.1-py27_0
removing cython-0.19.2-py33_0
removing cython-0.20.1-py27_0
removing datashape-0.2.0-np18py27_1
removing dateutil-2.1-py27_1
removing dateutil-2.1-py33_2
removing decorator-3.4.0-py26_0
removing decorator-3.4.0-py27_0
removing distribute-0.6.45-py27_0
removing distribute-0.6.45-py33_0
removing docutils-0.10-py27_0
removing docutils-0.11-py33_0
removing dulwich-0.9.7-py27_0
removing dynd-python-0.3.0-np17py27_0
removing dynd-python-0.5.0-np17py33_0
removing dynd-python-0.6.2-np18py27_0
removing enable-4.3.0-np18py27_2
removing enaml-0.7.6-py27_0
removing enaml-0.9.1-py27_1
removing flake8-2.1.0-py27_0
removing flake8-2.3.0-py27_0
removing flask-0.10.1-py27_0
removing flask-0.10.1-py33_1
removing future-0.12.1-py27_0
removing gdata-2.0.17-py27_0
removing gevent-0.13.8-py27_0
removing gevent-websocket-0.3.6-py27_2
removing gevent_zeromq-0.2.5-py27_2
removing greenlet-0.4.1-py27_0
removing greenlet-0.4.1-py33_0
removing h5py-2.1.1-np17py27_0
removing h5py-2.3.0-np18py27_0
removing hdf5-1.8.13-0
removing hdf5-1.8.9-0
removing hdf5-1.8.9-1
removing ipython-1.1.0-py27_0
removing ipython-1.1.0-py33_0
removing ipython-2.2.0-py27_1
removing ipython-2.3.0-py27_0
removing ipython-2.3.1-py27_0
removing ipython-notebook-0.13.2-py27_0
removing ipython-notebook-2.2.0-py27_0
removing ipython-notebook-2.3.1-py27_0
removing ipython-qtconsole-2.2.0-py27_0
removing ipython-qtconsole-3.0.0-py27_0
removing itsdangerous-0.23-py33_0
removing itsdangerous-0.24-py26_0
removing itsdangerous-0.24-py27_0
removing jdcal-1.0-py26_0
removing jdcal-1.0-py27_0
removing jinja2-2.6-py27_0
removing jinja2-2.7.1-py33_0
removing keyring-1.4-py27_0
removing kiwisolver-0.1.3-py27_0
removing launcher-0.1.1-py27_0
removing launcher-0.1.2-py27_1
removing launcher-0.1.5-py27_0
removing libdynd-0.3.0-0
removing libdynd-0.5.0-0
removing libdynd-0.6.2-0
removing libevent-2.0.20-0
removing libnetcdf-4.2.1.1-1
removing libxslt-1.1.28-1
removing llvm-3.2-0
removing llvmmath-0.1.0-np17py27_0
removing llvmmath-0.1.1-np17py33_2
removing llvmpy-0.11.3-py27_0
removing llvmpy-0.12.0-py33_0
removing llvmpy-0.12.6-py27_0
removing lxml-3.2.1-py27_0
removing lxml-3.2.3-py33_0
removing lxml-3.3.5-py27_0
removing lxml-3.4.0-py27_0
removing mako-0.8.0-py27_0
removing markupsafe-0.18-py33_0
removing matplotlib-1.2.1-np17py27_1
removing matplotlib-1.3.1-np17py33_0
removing matplotlib-1.3.1-np18py27_1
removing matplotlib-1.4.0-np19py27_0
removing mccabe-0.2.1-py27_1
removing mccabe-0.3-py27_1
removing mdp-3.3-np17py27_0
removing mdp-3.3-np17py33_0
removing mercurial-3.0-py27_0
removing mistune-0.5.1-py26_0
removing mistune-0.5.1-py27_0
removing mkl-11.1-np18py27_p2
removing mock-1.0.1-py26_0
removing mock-1.0.1-py27_0
removing multipledispatch-0.4.3-py27_0
removing netcdf4-1.0.6-np17py33_0
removing networkx-1.7-py27_0
removing networkx-1.8.1-py33_0
removing nltk-2.0.4-np17py27_0
removing nose-1.3.0-py33_0
removing nose-1.3.3-py27_0
removing nose-1.3.4-py27_0
removing numba-0.11.0-np17py33_0
removing numba-0.13.2-np18py27_0
removing numba-0.9.0-np17py27_0
removing numbapro-0.10.1-np17py27_p0
removing numbapro-0.14.1-np18py27_p0
removing numbapro_cudalib-0.1-0
removing numexpr-2.0.1-np17py27_3
removing numexpr-2.2.2-np17py33_0
removing numexpr-2.3.1-np18py27_p0
removing numpy-1.7.1-py27_0
removing numpy-1.7.1-py33_0
removing numpy-1.8.1-py27_p0
removing numpy-1.9.0-py27_p0
removing openpyxl-1.6.2-py33_0
removing openssl-1.0.1c-0
removing openssl-1.0.1h-0
removing openssl-1.0.1h-1
removing openssl-1.0.1j-4
removing openssl-1.0.1k-0
removing ordereddict-1.1-py26_0
removing pandas-0.11.0-np17py27_1
removing pandas-0.12.0-np17py33_0
removing pandas-0.14.0-np18py27_0
removing pandas-0.14.1-np19py27_0
removing patsy-0.2.1-np17py33_0
removing pep8-1.5.7-py27_0
removing pep8-1.6.2-py26_0
removing pep8-1.6.2-py27_0
removing pillow-2.1.0-py33_0
removing pip-1.3.1-py27_2
removing pip-1.4.1-py33_0
removing pip-1.5.6-py27_0
removing pip-6.0.6-py27_0
removing pip-6.0.8-py34_0
removing pip-coverage-2.7-0.0-py27_0
removing pip-ipdb-0.8-0.0-py27_0
removing ply-3.4-py33_0
removing psutil-0.7.1-py27_0
removing psutil-1.1.2-py33_0
removing py-1.4.14-py27_0
removing pyaudio-0.2.7-py27_0
removing pycosat-0.6.0-py33_0
removing pycosat-0.6.1-py26_0
removing pycosat-0.6.1-py27_0
removing pycparser-2.9.1-py27_0
removing pycparser-2.9.1-py33_0
removing pycrypto-2.6-py27_0
removing pycrypto-2.6.1-py33_0
removing pycurl-7.19.3.1-py27_2
removing pyflakes-0.7.2-py27_0
removing pyflakes-0.7.3-py33_0
removing pygments-1.6-py33_0
removing pyparsing-1.5.6-py33_0
removing pyparsing-2.0.3-py26_0
removing pyparsing-2.0.3-py27_0
removing pysal-1.5.0-np17py27_1
removing pytables-2.4.0-np17py27_0
removing pytables-3.0.0-np17py33_1
removing pytables-3.1.1-np18py27_0
removing pytest-2.3.5-py27_0
removing python-2.7.5-1
removing python-2.7.8-0
removing python-2.7.8-1
removing python.app-1.2-py27_0
removing python.app-1.2-py27_2
removing pytz-2013b-py33_0
removing pytz-2014.3-py27_0
removing pytz-2014.7-py27_0
removing pyyaml-3.10-py33_0
removing pyzmq-14.3.0-py27_0
removing pyzmq-14.3.1-py27_0
removing pyzmq-2.2.0.1-py33_1
removing readline-6.2-1
removing redis-py-2.7.2-py27_0
removing requests-1.2.3-py27_0
removing requests-1.2.3-py33_0
removing requests-2.3.0-py27_0
removing requests-2.4.1-py27_0
removing requests-2.4.3-py27_0
removing requests-2.5.0-py27_0
removing requests-2.5.1-py27_0
removing requests-2.5.3-py27_0
removing runipy-0.1.1-py27_0
removing scikit-image-0.10.0-np18py27_0
removing scikit-image-0.8.2-np17py27_1
removing scikit-image-0.9.3-np17py33_0
removing scikit-learn-0.13.1-np17py27_0
removing scikit-learn-0.14.1-np18py27_p1
removing scikits.bvp1lg-0.2.5-py27_0
removing scipy-0.12.0-np17py27_0
removing scipy-0.13.0-np17py33_0
removing scipy-0.14.0-np18py27_p0
removing scipy-0.14.0-np19py27_p0
removing setuptools-11.3.1-py27_0
removing setuptools-12.0.5-py27_0
removing setuptools-12.2-py27_0
removing setuptools-13.0.2-py27_0
removing setuptools-14.0-py26_0
removing setuptools-14.0-py27_0
removing setuptools-14.0-py34_0
removing setuptools-14.3-py26_0
removing setuptools-14.3-py27_0
removing setuptools-15.0-py26_0
removing setuptools-15.0-py27_0
removing setuptools-5.8-py27_0
removing setuptools-7.0-py27_0
removing share-eb21bd2b7a9bf800dab463134d15f4404983d5fe-0
removing six-1.4.1-py33_0
removing six-1.8.0-py27_0
removing six-1.9.0-py26_0
removing six-1.9.0-py27_0
removing sphinx-1.1.3-py27_3
removing sphinx-1.1.3-py33_4
removing sphinx-1.2.2-py27_0
removing spyder-2.2.0-py27_1
removing spyder-2.3.0rc1-py27_0
removing spyder-app-2.3.1-py27_0
removing spyder-app-2.3.4-py27_0
removing sqlalchemy-0.8.1-py27_0
removing sqlalchemy-0.8.3-py33_0
removing sqlalchemy-0.9.4-py27_0
removing sqlite-3.8.4.1-0
removing statsmodels-0.4.3-np17py27_1
removing statsmodels-0.5.0-np17py33_0
removing sympy-0.7.3-py33_0
removing tk-8.5.15-0
removing tornado-3.1-py27_0
removing tornado-3.1.1-py33_0
removing tornado-3.2.1-py27_0
removing ujson-1.33-py26_0
removing ujson-1.33-py27_0
removing werkzeug-0.9.1-py27_0
removing werkzeug-0.9.4-py33_0
removing werkzeug-0.9.6-py27_0
removing xlrd-0.9.2-py33_0
removing xlsxwriter-0.5.5-py27_0
removing xz-5.0.5-0
removing zope.interface-4.0.5-py27_0
In [21]:
!conda clean -t --dry-run
Cache location: /data/apps/anaconda/1.3.1/pkgs
Will remove the following tarballs:

_license-1.1-py27_0.tar.bz2                   72 KB
abstract-rendering-0.5.1-np19py26_0.tar.bz2      42 KB
abstract-rendering-0.5.1-np19py27_0.tar.bz2      42 KB
accelerate-1.7.0-np19py27_p0.tar.bz2           4 KB
anaconda-2.1.0-np19py27_0.tar.bz2              3 KB
anaconda-2.2.0-np19py26_0.tar.bz2              3 KB
anaconda-2.2.0-np19py27_0.tar.bz2              3 KB
appscript-1.0.1-py26_0.tar.bz2               122 KB
appscript-1.0.1-py27_0.tar.bz2               122 KB
argcomplete-0.8.1-py27_0.tar.bz2              27 KB
argcomplete-0.8.4-py26_0.tar.bz2              28 KB
argcomplete-0.8.4-py27_0.tar.bz2              28 KB
argparse-1.3.0-py26_0.tar.bz2                 34 KB
astropy-0.4.2-np19py27_0.tar.bz2             4.8 MB
astropy-1.0.1-np19py26_0.tar.bz2             5.1 MB
astropy-1.0.1-np19py27_0.tar.bz2             5.0 MB
atom-0.3.9-py27_0.tar.bz2                    111 KB
bcolz-0.8.1-np19py26_0.tar.bz2               343 KB
bcolz-0.8.1-np19py27_0.tar.bz2               345 KB
beautiful-soup-4.3.2-py26_0.tar.bz2          109 KB
beautiful-soup-4.3.2-py27_0.tar.bz2          109 KB
binstar-0.10.1-py27_3.tar.bz2                 74 KB
binstar-0.7.1-py27_0.tar.bz2                  73 KB
bitarray-0.8.1-py26_0.tar.bz2                 54 KB
blaze-0.6.3-np19py27_0.tar.bz2               124 KB
blaze-core-0.7.3-np19py26_0.tar.bz2          304 KB
blaze-core-0.7.3-np19py27_0.tar.bz2          305 KB
blz-0.6.2-np19py26_0.tar.bz2                 319 KB
blz-0.6.2-np19py27_0.tar.bz2                 342 KB
bokeh-0.6.1-np19py27_0.tar.bz2               2.9 MB
bokeh-0.8.1-np19py27_1.tar.bz2              13.5 MB
boto-2.32.1-py27_0.tar.bz2                   1.2 MB
boto-2.36.0-py26_0.tar.bz2                   1.3 MB
boto-2.36.0-py27_0.tar.bz2                   1.3 MB
cdecimal-2.3-py26_0.tar.bz2                  139 KB
cdecimal-2.3-py27_0.tar.bz2                  140 KB
certifi-14.05.14-py26_0.tar.bz2              154 KB
certifi-14.05.14-py27_0.tar.bz2              154 KB
cffi-0.8.6-py27_0.tar.bz2                    111 KB
cffi-0.9.2-py26_0.tar.bz2                    115 KB
cffi-0.9.2-py27_0.tar.bz2                    115 KB
chaco-4.4.1-np19py27_0.tar.bz2               856 KB
clyent-0.3.4-py27_0.tar.bz2                   13 KB
colorama-0.3.1-py27_0.tar.bz2                 15 KB
colorama-0.3.3-py26_0.tar.bz2                 17 KB
colorama-0.3.3-py27_0.tar.bz2                 17 KB
conda-3.10.1-py27_0.tar.bz2                  164 KB
conda-3.7.0-py27_0.tar.bz2                   154 KB
conda-3.7.1-py27_0.tar.bz2                   155 KB
conda-3.7.3-py27_0.tar.bz2                   156 KB
conda-3.7.4-py27_0.tar.bz2                   160 KB
conda-3.8.3-py27_0.tar.bz2                   162 KB
conda-3.8.4-py27_0.tar.bz2                   163 KB
conda-3.9.1-py27_0.tar.bz2                   164 KB
conda-env-2.0.1-py27_0.tar.bz2                14 KB
conda-env-2.1.0-py27_0.tar.bz2                14 KB
conda-env-2.1.2-py27_0.tar.bz2                15 KB
conda-env-2.1.3-py27_0.tar.bz2                15 KB
conda-env-2.1.4-py27_0.tar.bz2                15 KB
configobj-5.0.6-py26_0.tar.bz2                49 KB
configobj-5.0.6-py27_0.tar.bz2                49 KB
cryptography-0.5.4-py27_0.tar.bz2            262 KB
cryptography-0.8-py26_0.tar.bz2              348 KB
cryptography-0.8-py27_0.tar.bz2              349 KB
cudatoolkit-6.0-p0.tar.bz2                 171.4 MB
curl-7.38.0-0.tar.bz2                        361 KB
cython-0.21-py27_0.tar.bz2                   2.2 MB
cython-0.22-py26_0.tar.bz2                   2.2 MB
cython-0.22-py27_0.tar.bz2                   2.2 MB
cytoolz-0.7.0-py27_0.tar.bz2                 145 KB
cytoolz-0.7.2-py26_0.tar.bz2                 210 KB
cytoolz-0.7.2-py27_0.tar.bz2                 211 KB
datashape-0.3.0-np19py27_1.tar.bz2            83 KB
datashape-0.4.4-np19py26_1.tar.bz2            95 KB
datashape-0.4.4-np19py27_1.tar.bz2            95 KB
decorator-3.4.0-py26_0.tar.bz2                 8 KB
decorator-3.4.0-py27_0.tar.bz2                 8 KB
docutils-0.12-py26_0.tar.bz2                 635 KB
docutils-0.12-py27_0.tar.bz2                 636 KB
dynd-python-0.6.5-np19py26_0.tar.bz2         443 KB
dynd-python-0.6.5-np19py27_0.tar.bz2         442 KB
enable-4.3.0-np19py27_2.tar.bz2              1.4 MB
enaml-0.9.8-py27_0.tar.bz2                   657 KB
enum34-1.0.4-py26_0.tar.bz2                   48 KB
enum34-1.0.4-py27_0.tar.bz2                   48 KB
fastcache-1.0.2-py26_0.tar.bz2                23 KB
fastcache-1.0.2-py27_0.tar.bz2                23 KB
flake8-2.3.0-py27_0.tar.bz2                   25 KB
flask-0.10.1-py26_1.tar.bz2                  129 KB
freetype-2.5.2-0.tar.bz2                     691 KB
funcsigs-0.4-py26_0.tar.bz2                   19 KB
funcsigs-0.4-py27_0.tar.bz2                   19 KB
future-0.13.1-py27_0.tar.bz2                 877 KB
futures-2.1.6-py27_0.tar.bz2                  20 KB
futures-2.2.0-py26_0.tar.bz2                  21 KB
futures-2.2.0-py27_0.tar.bz2                  21 KB
gevent-1.0.1-py26_0.tar.bz2                  335 KB
gevent-websocket-0.9.3-py26_0.tar.bz2         24 KB
greenlet-0.4.4-py27_0.tar.bz2                 14 KB
greenlet-0.4.5-py26_0.tar.bz2                 14 KB
greenlet-0.4.5-py27_0.tar.bz2                 14 KB
grin-1.2.1-py26_1.tar.bz2                     23 KB
h5py-2.3.1-np19py27_0.tar.bz2                721 KB
h5py-2.4.0-np19py26_0.tar.bz2                672 KB
h5py-2.4.0-np19py27_0.tar.bz2                663 KB
hdf5-1.8.13-0.tar.bz2                        1.5 MB
hdf5-1.8.13-1.tar.bz2                        1.8 MB
hdf5-1.8.14-0.tar.bz2                        1.5 MB
ipython-2.2.0-py27_1.tar.bz2                 2.8 MB
ipython-2.3.0-py27_0.tar.bz2                 2.8 MB
ipython-2.3.1-py27_0.tar.bz2                 2.8 MB
ipython-3.0.0-py27_0.tar.bz2                 3.3 MB
ipython-notebook-2.2.0-py27_0.tar.bz2          5 KB
ipython-notebook-2.3.1-py27_0.tar.bz2          5 KB
ipython-notebook-3.0.0-py27_1.tar.bz2          5 KB
ipython-qtconsole-2.2.0-py27_0.tar.bz2         4 KB
ipython-qtconsole-3.0.0-py27_0.tar.bz2         4 KB
itsdangerous-0.24-py26_0.tar.bz2              16 KB
itsdangerous-0.24-py27_0.tar.bz2              16 KB
jdcal-1.0-py26_0.tar.bz2                       9 KB
jdcal-1.0-py27_0.tar.bz2                       9 KB
jedi-0.8.1-py26_0.tar.bz2                    171 KB
jedi-0.8.1-py27_0.tar.bz2                    171 KB
jinja2-2.7.3-py26_1.tar.bz2                  307 KB
jinja2-2.7.3-py27_1.tar.bz2                  307 KB
jsonschema-2.4.0-py26_0.tar.bz2               52 KB
jsonschema-2.4.0-py27_0.tar.bz2               51 KB
kiwisolver-0.1.3-py27_0.tar.bz2               62 KB
launcher-1.0.0-1.tar.bz2                     1.8 MB
launcher-1.0.0-2.tar.bz2                     1.8 MB
libdynd-0.6.5-0.tar.bz2                      3.9 MB
libtiff-4.0.2-1.tar.bz2                      270 KB
llvmlite-0.2.2-py26_1.tar.bz2                5.9 MB
llvmlite-0.2.2-py27_1.tar.bz2                5.9 MB
llvmpy-0.12.7-py27_0.tar.bz2                 512 KB
lxml-3.4.0-py27_0.tar.bz2                    944 KB
lxml-3.4.2-py26_0.tar.bz2                    943 KB
lxml-3.4.2-py27_0.tar.bz2                    945 KB
markupsafe-0.23-py26_0.tar.bz2                22 KB
markupsafe-0.23-py27_0.tar.bz2                22 KB
matplotlib-1.4.0-np19py27_0.tar.bz2         41.0 MB
matplotlib-1.4.3-np19py26_1.tar.bz2         40.8 MB
matplotlib-1.4.3-np19py27_0.tar.bz2         40.9 MB
matplotlib-1.4.3-np19py27_1.tar.bz2         40.9 MB
mccabe-0.3-py27_1.tar.bz2                      9 KB
mercurial-3.3.3-py27_0.tar.bz2               1.5 MB
mistune-0.5.1-py26_0.tar.bz2                  19 KB
mistune-0.5.1-py27_0.tar.bz2                  18 KB
mkl-11.1-np19py27_p3.tar.bz2                   4 KB
mklfft-1.0-np19py27_p0.tar.bz2                30 KB
mock-1.0.1-py26_0.tar.bz2                     36 KB
mock-1.0.1-py27_0.tar.bz2                     36 KB
multipledispatch-0.4.7-py26_0.tar.bz2         11 KB
multipledispatch-0.4.7-py27_0.tar.bz2         11 KB
networkx-1.9.1-py26_0.tar.bz2                936 KB
networkx-1.9.1-py27_0.tar.bz2                934 KB
nltk-3.0.0-np19py27_0.tar.bz2                1.4 MB
nltk-3.0.2-np19py26_0.tar.bz2                1.5 MB
nltk-3.0.2-np19py27_0.tar.bz2                1.5 MB
node-webkit-0.10.1-0.tar.bz2                26.1 MB
nose-1.3.4-py26_1.tar.bz2                    190 KB
nose-1.3.4-py27_0.tar.bz2                    189 KB
nose-1.3.4-py27_1.tar.bz2                    189 KB
numba-0.14.0-np19py27_0.tar.bz2              675 KB
numba-0.17.0-np19py26_0.tar.bz2              775 KB
numba-0.17.0-np19py27_0.tar.bz2              774 KB
numbapro-0.15.0-np19py27_p0.tar.bz2          128 KB
numbapro_cudalib-0.1-0.tar.bz2               1.3 MB
numexpr-2.3.1-np19py26_0.tar.bz2              99 KB
numexpr-2.3.1-np19py27_0.tar.bz2              99 KB
numexpr-2.3.1-np19py27_p0.tar.bz2            100 KB
numpy-1.9.0-py27_p0.tar.bz2                  2.9 MB
numpy-1.9.1-py27_p0.tar.bz2                  2.9 MB
numpy-1.9.2-py26_0.tar.bz2                   2.9 MB
numpy-1.9.2-py27_0.tar.bz2                   2.9 MB
odo-0.3.1-np19py26_0.tar.bz2                 138 KB
odo-0.3.1-np19py27_0.tar.bz2                 138 KB
openssl-1.0.1h-1.tar.bz2                     2.3 MB
openssl-1.0.1j-4.tar.bz2                     2.5 MB
openssl-1.0.1k-0.tar.bz2                     2.5 MB
openssl-1.0.1k-1.tar.bz2                     2.5 MB
ordereddict-1.1-py26_0.tar.bz2                 4 KB
pandas-0.14.1-np19py27_0.tar.bz2             4.5 MB
pandas-0.15.2-np19py26_1.tar.bz2             4.7 MB
pandas-0.15.2-np19py27_0.tar.bz2             4.7 MB
pandas-0.15.2-np19py27_1.tar.bz2             4.7 MB
patsy-0.3.0-np19py26_0.tar.bz2               310 KB
patsy-0.3.0-np19py27_0.tar.bz2               311 KB
pep8-1.5.7-py27_0.tar.bz2                     43 KB
pep8-1.6.2-py26_0.tar.bz2                     46 KB
pep8-1.6.2-py27_0.tar.bz2                     46 KB
pillow-2.7.0-py26_1.tar.bz2                  448 KB
pillow-2.7.0-py27_0.tar.bz2                  453 KB
pillow-2.7.0-py27_1.tar.bz2                  452 KB
pip-6.0.6-py27_0.tar.bz2                     1.5 MB
pip-6.0.8-py26_0.tar.bz2                     1.5 MB
pip-6.0.8-py27_0.tar.bz2                     1.5 MB
pip-6.0.8-py34_0.tar.bz2                     1.6 MB
ply-3.4-py26_0.tar.bz2                        67 KB
psutil-2.2.1-py26_0.tar.bz2                   93 KB
psutil-2.2.1-py27_0.tar.bz2                   93 KB
ptyprocess-0.4-py27_0.tar.bz2                 19 KB
py-1.4.25-py27_0.tar.bz2                     121 KB
py-1.4.26-py26_0.tar.bz2                     121 KB
py-1.4.26-py27_0.tar.bz2                     121 KB
pyasn1-0.1.7-py26_0.tar.bz2                   47 KB
pyasn1-0.1.7-py27_0.tar.bz2                   48 KB
pyaudio-0.2.7-py27_0.tar.bz2                  60 KB
pycosat-0.6.1-py26_0.tar.bz2                  56 KB
pycosat-0.6.1-py27_0.tar.bz2                  56 KB
pycparser-2.10-py26_0.tar.bz2                144 KB
pycrypto-2.6.1-py26_0.tar.bz2                443 KB
pycurl-7.19.5-py27_1.tar.bz2                  42 KB
pycurl-7.19.5.1-py26_0.tar.bz2                42 KB
pycurl-7.19.5.1-py27_0.tar.bz2                42 KB
pyflakes-0.8.1-py26_0.tar.bz2                 50 KB
pygments-2.0.2-py26_0.tar.bz2                1.0 MB
pygments-2.0.2-py27_0.tar.bz2                1.0 MB
pyopenssl-0.14-py26_0.tar.bz2                122 KB
pyopenssl-0.14-py27_0.tar.bz2                122 KB
pyparsing-2.0.3-py26_0.tar.bz2                63 KB
pyparsing-2.0.3-py27_0.tar.bz2                63 KB
pyqt-4.11.3-py26_0.tar.bz2                   4.0 MB
pyqt-4.11.3-py27_0.tar.bz2                   4.0 MB
pytables-3.1.1-np19py26_2.tar.bz2            1.4 MB
pytables-3.1.1-np19py27_0.tar.bz2            1.4 MB
pytables-3.1.1-np19py27_2.tar.bz2            1.4 MB
pytest-2.6.3-py27_0.tar.bz2                  177 KB
pytest-2.6.4-py26_0.tar.bz2                  178 KB
pytest-2.6.4-py27_0.tar.bz2                  178 KB
python-2.6.9-1.tar.bz2                       9.0 MB
python-2.7.8-1.tar.bz2                       9.8 MB
python-2.7.9-1.tar.bz2                      11.3 MB
python-3.4.3-0.tar.bz2                      19.1 MB
python-dateutil-2.4.1-py26_0.tar.bz2         217 KB
python-dateutil-2.4.1-py27_0.tar.bz2         218 KB
python.app-1.2-py26_3.tar.bz2                  7 KB
python.app-1.2-py27_3.tar.bz2                  7 KB
pytz-2014.7-py27_0.tar.bz2                   175 KB
pytz-2014.9-py27_0.tar.bz2                   175 KB
pytz-2015.2-py26_0.tar.bz2                   175 KB
pytz-2015.2-py27_0.tar.bz2                   175 KB
pyyaml-3.11-py26_0.tar.bz2                   146 KB
pyzmq-14.3.1-py27_0.tar.bz2                  275 KB
pyzmq-14.4.1-py27_0.tar.bz2                  290 KB
pyzmq-14.5.0-py26_0.tar.bz2                  290 KB
pyzmq-14.5.0-py27_0.tar.bz2                  290 KB
qt-4.8.6-0.tar.bz2                          39.0 MB
redis-py-2.10.3-py26_0.tar.bz2                70 KB
redis-py-2.10.3-py27_0.tar.bz2                70 KB
requests-2.4.1-py27_0.tar.bz2                577 KB
requests-2.4.3-py27_0.tar.bz2                578 KB
requests-2.5.0-py27_0.tar.bz2                586 KB
requests-2.5.1-py27_0.tar.bz2                586 KB
requests-2.5.3-py27_0.tar.bz2                592 KB
requests-2.6.0-py26_0.tar.bz2                593 KB
requests-2.6.0-py27_0.tar.bz2                594 KB
rope-0.9.4-py26_1.tar.bz2                    225 KB
runipy-0.1.1-py27_0.tar.bz2                   11 KB
runipy-0.1.3-py27_0.tar.bz2                    9 KB
scikit-image-0.10.1-np19py27_0.tar.bz2      14.4 MB
scikit-image-0.11.2-np19py26_0.tar.bz2      16.1 MB
scikit-image-0.11.2-np19py27_0.tar.bz2      16.1 MB
scikit-learn-0.15.2-np19py26_0.tar.bz2       3.1 MB
scikit-learn-0.15.2-np19py27_0.tar.bz2       3.1 MB
scikit-learn-0.15.2-np19py27_p0.tar.bz2      3.1 MB
scipy-0.14.0-np19py27_p0.tar.bz2            11.5 MB
scipy-0.15.1-np19py26_0.tar.bz2             12.0 MB
scipy-0.15.1-np19py27_0.tar.bz2             12.1 MB
scipy-0.15.1-np19py27_p0.tar.bz2            12.1 MB
seaborn-0.5.1-np19py27_0.tar.bz2             185 KB
setuptools-11.3.1-py27_0.tar.bz2             430 KB
setuptools-12.0.5-py27_0.tar.bz2             436 KB
setuptools-12.2-py27_0.tar.bz2               437 KB
setuptools-13.0.2-py27_0.tar.bz2             436 KB
setuptools-14.0-py26_0.tar.bz2               438 KB
setuptools-14.0-py27_0.tar.bz2               435 KB
setuptools-14.0-py34_0.tar.bz2               440 KB
setuptools-14.3-py26_0.tar.bz2               438 KB
setuptools-14.3-py27_0.tar.bz2               435 KB
setuptools-15.0-py26_0.tar.bz2               439 KB
setuptools-15.0-py27_0.tar.bz2               436 KB
setuptools-5.8-py27_0.tar.bz2                426 KB
setuptools-7.0-py27_0.tar.bz2                436 KB
sip-4.16.5-py26_0.tar.bz2                    234 KB
sip-4.16.5-py27_0.tar.bz2                    234 KB
six-1.8.0-py27_0.tar.bz2                      15 KB
six-1.9.0-py26_0.tar.bz2                      16 KB
six-1.9.0-py27_0.tar.bz2                      16 KB
sockjs-tornado-1.0.1-py26_0.tar.bz2           31 KB
sockjs-tornado-1.0.1-py27_0.tar.bz2           31 KB
sphinx-1.2.3-py26_0.tar.bz2                 1004 KB
sphinx-1.2.3-py27_0.tar.bz2                 1005 KB
spyder-2.3.1-py27_1.tar.bz2                  4.0 MB
spyder-2.3.4-py27_1.tar.bz2                  4.0 MB
spyder-app-2.3.1-py27_0.tar.bz2                7 KB
spyder-app-2.3.4-py27_0.tar.bz2                7 KB
sqlalchemy-0.9.7-py27_0.tar.bz2              1.2 MB
sqlalchemy-0.9.9-py26_0.tar.bz2              1.2 MB
sqlalchemy-0.9.9-py27_0.tar.bz2              1.2 MB
sqlite-3.8.4.1-1.tar.bz2                     824 KB
ssl_match_hostname-3.4.0.2-py26_0.tar.bz2       6 KB
statsmodels-0.5.0-np19py27_2.tar.bz2         5.4 MB
statsmodels-0.6.1-np19py26_0.tar.bz2         4.6 MB
statsmodels-0.6.1-np19py27_0.tar.bz2         4.6 MB
sympy-0.7.6-py26_0.tar.bz2                   6.1 MB
sympy-0.7.6-py27_0.tar.bz2                   6.2 MB
terminado-0.5-py27_0.tar.bz2                  17 KB
tk-8.5.18-0.tar.bz2                          1.9 MB
toolz-0.7.0-py27_0.tar.bz2                    27 KB
toolz-0.7.1-py26_0.tar.bz2                    27 KB
toolz-0.7.1-py27_0.tar.bz2                    27 KB
tornado-4.0.2-py27_0.tar.bz2                 449 KB
tornado-4.1-py26_0.tar.bz2                   475 KB
tornado-4.1-py27_0.tar.bz2                   474 KB
ujson-1.33-py26_0.tar.bz2                     19 KB
ujson-1.33-py27_0.tar.bz2                     19 KB
unicodecsv-0.9.4-py26_0.tar.bz2               18 KB
unicodecsv-0.9.4-py27_0.tar.bz2               17 KB
unittest2-0.8.0-py26_0.tar.bz2               136 KB
werkzeug-0.10.1-py26_0.tar.bz2               373 KB
werkzeug-0.10.1-py27_0.tar.bz2               374 KB
werkzeug-0.9.6-py27_1.tar.bz2                488 KB
xlrd-0.9.3-py26_0.tar.bz2                    158 KB
xlsxwriter-0.5.7-py27_0.tar.bz2              163 KB
xlsxwriter-0.6.7-py26_0.tar.bz2              174 KB
xlsxwriter-0.6.7-py27_0.tar.bz2              175 KB
xlwings-0.3.4-py26_0.tar.bz2                 149 KB
xlwings-0.3.4-py27_0.tar.bz2                 149 KB
xlwt-0.7.5-py26_0.tar.bz2                    172 KB
xz-5.0.5-0.tar.bz2                           132 KB
yt-3.0.2-np19py27_0.tar.bz2                  3.0 MB
zlib-1.2.8-0.tar.bz2                          83 KB
zope.interface-4.1.1-py27_0.tar.bz2          140 KB
-------------------------------------------------------
Total:                                     793.2 MB

Dry run: exiting

PyEnv

From the docs: "pyenvpyenv lets you easily switch between multiple versions of Python. It's simple, unobtrusive, and follows the UNIX tradition of single-purpose tools that do one thing well."

Cheatsheet

  • pyenv install --list: See all available versions.

Basic Packages and Configuration

Here is a list of basic packages that I always use. I install these in two custom environments work2 and work3. I also make a symlink called work which points to the appropriate environment in which I am currently working.

First, however, I install the following in the default conda environment:

In [6]:
%%bash
. deactivate 2> /dev/null
#conda install -y --revision=0               # Revert to original revision: Removes conda!
conda update -y conda                       # Update conda 
conda config --append channels conda-forge  # Added conda-forge channel
# Now install all additional packages
conda install -y argcomplete mercurial conda-build anaconda-client
conda update -y --all                       # Update all other packages
conda list
#pip install -U hg-git python-hglib
Unsetting IPYTHONDIR
Unsetting TALENT2015DIR
Fetching package metadata ...........
.
Package plan for installation in environment /data/apps/anaconda:

The following packages will be REMOVED:

    anaconda-client: 1.5.1-py27_0    defaults
    argcomplete:     1.0.0-py27_1    defaults
    clyent:          1.2.2-py27_0    defaults
    conda-build:     2.0.1-py27_0    defaults
    enum34:          1.1.6-py27_0    defaults
    filelock:        2.0.6-py27_0    defaults
    jinja2:          2.8-py27_1      defaults
    markupsafe:      0.23-py27_2     defaults
    mercurial:       3.9-py27_0      defaults
    pip:             8.1.2-py27_0    defaults
    pycrypto:        2.6.1-py27_4    defaults
    python-dateutil: 2.5.3-py27_0    defaults
    pytz:            2016.6.1-py27_0 defaults
    readline:        6.2-2           defaults
    ruamel_yaml:     0.11.14-py27_0  defaults
    setuptools:      27.2.0-py27_0   defaults
    six:             1.10.0-py27_0   defaults
    sqlite:          3.13.0-0        defaults
    tk:              8.5.18-0        defaults
    wheel:           0.29.0-py27_0   defaults
    yaml:            0.1.6-0         defaults
    zlib:            1.2.8-3         defaults

The following packages will be DOWNGRADED due to dependency conflicts:

    conda:           4.2.7-py27_0    defaults --> 3.12.0-py27_0 defaults
    conda-env:       2.6.0-0         defaults --> 2.1.4-py27_0  defaults
    openssl:         1.0.2i-0        defaults --> 1.0.1k-1      defaults
    pycosat:         0.6.1-py27_1    defaults --> 0.6.1-py27_0  defaults
    python:          2.7.12-1        defaults --> 2.7.9-1       defaults
    pyyaml:          3.12-py27_0     defaults --> 3.11-py27_0   defaults
    requests:        2.11.1-py27_0   defaults --> 2.7.0-py27_0  defaults

Unlinking packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################| 100%
Fetching package metadata: ........
Solving package specifications: .
Package plan for installation in environment /data/apps/anaconda:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    sqlite-3.13.0              |                1         1.4 MB  conda-forge
    enum34-1.1.6               |           py27_1          54 KB  conda-forge
    ------------------------------------------------------------
                                           Total:         1.4 MB

The following NEW packages will be INSTALLED:

    enum34:      1.1.6-py27_1   conda-forge
    pip:         8.1.2-py27_0   defaults   
    readline:    6.2-2          defaults   
    ruamel_yaml: 0.11.14-py27_0 defaults   
    setuptools:  27.2.0-py27_0  defaults   
    sqlite:      3.13.0-1       conda-forge
    tk:          8.5.18-0       defaults   
    wheel:       0.29.0-py27_0  defaults   
    yaml:        0.1.6-0        defaults   
    zlib:        1.2.8-3        defaults   

The following packages will be UPDATED:

    conda:       3.12.0-py27_0 defaults --> 4.2.7-py27_0   defaults   
    conda-env:   2.1.4-py27_0  defaults --> 2.6.0-0        defaults   
    openssl:     1.0.1k-1      defaults --> 1.0.2i-0       defaults   
    pycosat:     0.6.1-py27_0  defaults --> 0.6.1-py27_1   defaults   
    python:      2.7.9-1       defaults --> 2.7.12-1       defaults   
    requests:    2.7.0-py27_0  defaults --> 2.11.1-py27_0  defaults   

Fetching packages ...
sqlite-3.13.0- 100% |###############################| Time: 0:00:01   1.06 MB/s
enum34-1.1.6-p 100% |###############################| Time: 0:00:00 307.90 kB/s
Extracting packages ...
[      COMPLETE      ]|##################################################| 100%
Unlinking packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################| 100%
Fetching package metadata ...........
Solving package specifications: ..........

Package plan for installation in environment /data/apps/anaconda:

The following NEW packages will be INSTALLED:

    anaconda-client: 1.5.1-py27_0    defaults
    argcomplete:     1.0.0-py27_1    defaults
    clyent:          1.2.2-py27_0    defaults
    conda-build:     2.0.1-py27_0    defaults
    filelock:        2.0.6-py27_0    defaults
    jinja2:          2.8-py27_1      defaults
    markupsafe:      0.23-py27_2     defaults
    mercurial:       3.9-py27_0      defaults
    pycrypto:        2.6.1-py27_4    defaults
    python-dateutil: 2.5.3-py27_0    defaults
    pytz:            2016.6.1-py27_0 defaults
    six:             1.10.0-py27_0   defaults

The following packages will be UPDATED:

    pyyaml:          3.11-py27_0     defaults --> 3.12-py27_0 defaults

Unlinking packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################| 100%
Fetching package metadata ...........
Solving package specifications: ..........

Package plan for installation in environment /data/apps/anaconda:

The following packages will be SUPERCEDED by a higher-priority channel:

    enum34: 1.1.6-py27_1 https://conda.binstar.org/conda-forge --> 1.1.6-py27_0 defaults
    sqlite: 3.13.0-1     https://conda.binstar.org/conda-forge --> 3.13.0-0     defaults

Unlinking packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################| 100%
# packages in environment at /data/apps/anaconda:
#
anaconda-client           1.5.1                    py27_0    defaults
argcomplete               1.0.0                    py27_1    defaults
clyent                    1.2.2                    py27_0    defaults
conda                     4.2.7                    py27_0    defaults
conda-build               2.0.1                    py27_0    defaults
conda-env                 2.6.0                         0    defaults
enum34                    1.1.6                    py27_0    defaults
filelock                  2.0.6                    py27_0    defaults
jinja2                    2.8                      py27_1    defaults
markupsafe                0.23                     py27_2    defaults
mercurial                 3.9                      py27_0    defaults
openssl                   1.0.2i                        0    defaults
pip                       8.1.2                    py27_0    defaults
pycosat                   0.6.1                    py27_1    defaults
pycrypto                  2.6.1                    py27_4    defaults
python                    2.7.12                        1    defaults
python-dateutil           2.5.3                    py27_0    defaults
pytz                      2016.6.1                 py27_0    defaults
pyyaml                    3.12                     py27_0    defaults
readline                  6.2                           2    defaults
requests                  2.11.1                   py27_0    defaults
ruamel_yaml               0.11.14                  py27_0    defaults
setuptools                27.2.0                   py27_0    defaults
six                       1.10.0                   py27_0    defaults
sqlite                    3.13.0                        0    defaults
tk                        8.5.18                        0    defaults
wheel                     0.29.0                   py27_0    defaults
yaml                      0.1.6                         0    defaults
zlib                      1.2.8                         3    defaults
Warning: 'conda-forge' already in 'channels' list, moving to the bottom

Now I add the default path to both the start and end of %PATH with different names in my .bashrc file:

export PATH="/data/apps/anaconda/bin:$PATH:/data/apps/anaconda/bin/."

The reason for the latter addition is:

  1. It will be a fallback when activating other environments so I can still use mercurial.
  2. By giving it a different name it will not be removed when . deactivate is called.

Here is the process for creating my new work environments including some subtle issues:

  • As per issue 280, anaconda's packages for nose and flake8 are broken and do not register the distutils entry point, thus I remove these.
  • Many of these tools are for high performance computation.
In [ ]:
%%bash
. deactivate 2> /dev/null
conda create -n work2 --clone py2a
conda install -y accelerate coverage zope.interface -n work2
conda install -y line_profiler -n work2
conda update -y --all -n work2
conda remove -y nose pyflake8 -n work2

. activate work2
pip install -U nose pyflake8 memory_profiler
pip install -U nikola webassets    # For blogging
pip install -U pyfftw              # Needs the FFTW (from source, install all precisions)
pip install -U pygsl               # Needs the GSL (port install gsl)
pip install -U uncertainties       # uncertainties package I work with for error analysis
pip install -U rope jedi yapf      # Used by elpy mode in emacs.

Activate and Deactivate Scripts

When sourcing the activate and deactivate scripts, files "$CONDA_ROOT/etc/conda/activate.d/*.sh" and "$CONDA_ROOT/etc/conda/deactivate.d/*.sh" will be sourced. This allows one to perform additional configurations such as setting IPYTHONDIR. To find CONDA_ROOT programatically use:

In [1]:
%%bash
CONDA_ROOT="$(conda info -e | grep '*' | cut -d '*' -f2 | sed 's/^ *//g')"
echo CONDA_ROOT=$CONDA_ROOT
CONDA_ROOT=/data/apps/anaconda/envs/work

For example, the following two scripts to set and reset (once) IPYTHONDIR:

  • /data/apps/anaconda/envs/work/etc/conda/activate.d/set_ipythondir.sh
if [ ! -z \${IPYTHONDIR+x} ]; then
   export OLD_IPYTHONDIR="\$IPYTHONDIR"
fi
export IPYTHONDIR="/data/apps/anaconda/envs/work/.ipython"
  • /data/apps/anaconda/envs/work/etc/conda/deactivate.d/unset_ipythondir.sh
if [ -z \${OLD_IPYTHONDIR+x} ]; then
   unset IPYTHONDIR
else
   export IPYTHONDIR="\$OLD_IPYTHONDIR"
   unset OLD_IPYTHONDIR
fi

I make these files with a script like the following which I can run in the appropriate environment to set the .ipython directory in the current folder as the IPYTHONDIR for the environment. Note: It does some checks to make sure that an environment is active.

#!/bin/bash

CONDA_ROOT="$(conda info --root)"
CONDA_ENV="$(conda info -e | grep '*' | cut -d '*' -f2 | sed 's/^ *//g')"
if [ "$CONDA_ROOT" == "$CONDA_ENV" ]; then
  echo "Not in a conda environment.  Activate the environment first. I.e.:"
  echo
  echo "    . activate work"
  echo
  exit 1
else
  echo "Creating activate and deactivate scripts:"
  echo
  echo "   $CONDA_ENV/etc/conda/activate.d/set_ipythondir.sh"
  echo "   $CONDA_ENV/etc/conda/deactivate.d/unset_ipythondir.sh"
  echo
fi

mkdir -p "$CONDA_ENV/etc/conda/activate.d"
mkdir -p "$CONDA_ENV/etc/conda/deactivate.d"
IPYTHONDIR="$(cd .ipython && pwd)"
cat <<EOF > "$CONDA_ENV/etc/conda/activate.d/set_ipythondir.sh"
# This file sets the IPYTHONDIR environmental variable to use the
# settings in $IPYTHONDIR
# It is called when you activate the $CONDA_ENV environment with
#
#   . activate $CONDA_ENV

if [ ! -z \${IPYTHONDIR+x} ]; then
   export OLD_IPYTHONDIR="\$IPYTHONDIR"
fi
echo Setting IPYTHONDIR="$IPYTHONDIR"
export IPYTHONDIR="$IPYTHONDIR"
EOF
cat <<EOF > "$CONDA_ENV/etc/conda/deactivate.d/unset_ipythondir.sh"
# This file resets the IPYTHONDIR environmental to the previous value.
# It is called when you deactivate the $CONDA_ENV environment with
#
#   . deactivate

if [ -z \${OLD_IPYTHONDIR+x} ]; then
   echo Unsetting IPYTHONDIR
   unset IPYTHONDIR
else
   echo Resetting IPYTHONDIR="\$OLD_IPYTHONDIR"
   export IPYTHONDIR="\$OLD_IPYTHONDIR"
   unset OLD_IPYTHONDIR
fi
EOF

. "$CONDA_ENV/etc/conda/activate.d/set_ipythondir.sh"

Development

If you are developing software, the conda-devenv package might help. It allows you to maintain several dependent environment files for example. This might be useful when you want to have separate environment files for testing python 2 and python 3. Useful features include (from the docs):

  • Jinja 2 support: gives more flexibility to the environment definition, for example making it simple to conditionally add dependencies based on platform.
  • include other environment.devenv.yml files: this allows you to easily work in several dependent projects at the same time, managing a single conda environment with your dependencies.
  • Environment variables: you can define a environment: section with environment variables that should be defined when the environment is activated.

Packages and Dependencies

Making sure that you have all of the required packages installed can be a bit of a pain. I have toyed with three different types of strategies outlined below. I currently use method 1. when actively developing, then switch to a version that supports both 2. and 3.

  1. Include the source code for projects you need as weak dependencies managed with the myrepos (mr) tool:

    Basically, I include a .mrconfig file which instructs mr how to checkout the required projects:

    [_ext/pymmf]
    checkout = hg clone 'https://bitbucket.org/mforbes/pymmf' 'pymmf'
    

    When I run mr checkout, this project will be cloned to _ext/pymmf and I can then symlink the appropriate files to a top-level module ln -s _ext/pymmf/mmf mmf. If you use pymmf in many projects, you can replace _ext/pymmf with a simlink to an appropriate common location (but keep in mind that each project will be using the same revision then.)

    A small set of additional command can give mr freeze which tracks the specific verions. There are some bugs with this, but you can see an example in my mmfhg project, in particular in the mrconfig file.

    This approach is useful if you need to activately develop both the top level project and the subproject, but requires manual intervention to update etc. and is not suitable for general usage since collaborators will need to add myrepos to their toolchain.

  2. Write a setup.py file and use this or pip to manage the dependencies.

    This is a better choice for general distribution and collaboration, but still has a few warts. An advantage of this over the next option is that it will then work with PyPI.

  3. Write a meta.yaml file and use conda to manage dependencies.

    This is a good choice for general distribution if you want your package to be installable with conda from Anaconda Cloud.

Setuptools and Pip

The Python Packaging User Guide is supposed to provide the definitive guide for managing python packages. Its current recommendations for installing packages is to use pip, so we would like to maintain that strategy. The basic idea here is to include a setup.py file in your top level directory that specifies your dependencies (and example will be provided below). This is designed for and works well will packages published on PyPI but starts failing when you need to depend on projects that are not published (i.e. those hosted on github or bitbucket.)

Setup(.py) and Requirements(.txt)

Some of the issues are discussed in this rant but are centered around the issue of how to specify the location of code not available on PyPI. Both pip and setuptools support installation from version controlled sources. The recommended approach for this (see Setup vs. Requirements is to put these dependencies in a requirements.txt file, but there are problems with this approach:

  1. Users must run pip install -r requirements.txt explicitly rather than just pip install -e . or python setup.py develop.

    This is probably not such a big deal as long as the install instructions are clear.

  2. If you require a subproject that also has requirements.txt, there is no easy way of recursively parsing the subprojects requirements. (The requirements specified in the subprojects setup.py will get processed.

    The only solution I know to this second issue is to make sure your requirements.txt file is very complete, specifying all possible requirements recursively.

  3. Suppose that you use branches or tags in your code to mark versions. Now suppose that one project A that depends on another project B, and that B depends on a specific version of C==0.9. You dutifully include this in the setup.py files:

    # A's setup.py
    install_requires = ["B"]
    
    # B's setup.py
    install_requires = ["C==0.9"]
    

    However, at this point, neither pip nor setuptools can install A since neither B nor C are installed on PyPI. The recommended solution is to specify all of the dependences in A's requirements.txt file:

    -e hg+ssh://hg@bitbucket.org/mforbes/B#egg=B
    -e hg+ssh://hg@bitbucket.org/mforbes/C#egg=C
    -e .
    

    Installing A with pip install -r requirements.txt will now install B and C, but the requirements are now broken. The package C for example will be installed at the latest version, even if this breaks the C==0.9 requirement by B. This appears to be broken even if we provide the explicit versions in the requirements.txt file:

    -e hg+ssh://hg@bitbucket.org/mforbes/B#egg=B
    -e hg+ssh://hg@bitbucket.org/mforbes/C@0.8#egg=C-0.8
    -e .
    

    Thus we are left in the awkward position of having to make sure in project A that we pin the exact requirements we need in subproject C even though we do not (directly) depend on it.

The problem described above is consistent with the following roles of setup.py and requirements.txt:

  • The install_requires argument to setup() in setup.py specifies what is required and version information should be used to specify what does not work (i.e. avoid this version).
  • The requirements.txt specifies exactly one situation that does work.

In case of conflict, the second point here seems to override the first one (C-0.8 above gets installed even though the setup for B specifies C==0.9).

Thus, requirements.txt is completely useless for specifying dependencies in a general way. The only solution here appears to be to carefully construct a requirements.txt file whenever a project or its dependencies change. The following tools may help with this, but I am not happy with this solution:

A Better Solution: Host your own Index

Can we get the benefits of the usual dependency resolution while using version controlled software? To do this, it seems that you need to host your packages through an index via one of the following approaches:

  • Upload your package to PyPI: This works, but requires a lot of discipline and maintenance to make sure your package is complete, tested, working, and properly described whenever you need to freeze it. The whole release process can be a pain, and submitting a bunch or random tools to PyPI is considered bad practice. (For one thing, there is a global namespace, so you might steal a useful name for a bunch of specialized tools where another package might have been able to better use it for the community.)
  • Host your own Package Index.

The latter approach seems at first to require running a web-server somewhere which is off-putting, but actually supports two quite reasonable solutions. The first is to package tarballs of your projects into a single directory with canonical names like C-0.8.tar.gz, and C-0.9.tar.gz and then point to this with the pip --find-links <dir> option. (The tarballs can be produced with python setup.py sdist and will get deposited in the dist directory which you could symlink to the <dir> specified above.)

The second solution is to provide a proper package index somewhere. This allows you to refer to additional locations, and in particular, allows you to refer to something like

<a href="https://bitbucket.org/mforbes/persist/get/0.9.tar.bz2#egg=persist-0.9">persist-0.9</a>.

This uses the packaging feature at bitbucket that will checkout version 0.9 from the repository and deliver it as a tarball. The resulting index file can be hosted somewhere globally and referred to with pip install --extra-index-url <url>.

Package Index API

The Package Index "API" is basically a set of nested directories of the form packagename/version with index.html files that will describe how to download the package with links like those shown above.

This works, but is a PITA since it seems to require:

  1. The whole nested directory structure (so you can't just manage a single file).
  2. Requires that these index files be server from a proper web server that will dish them up when given a trailing slash https://.../packagename/versions/. I still don't know why they can't just also look for the index files. I have asked on the mailing list.

Visualizing Dependencies

Pip

Try the pipdeptree package. Unfortunately, this lists all dependencies in a conda environment.

pip install pipdeptree

Conda

Here is a strategy based on Eric Dill's render_env.py GIST. We use it to find all of the roots in an environment (packages upon which nothing depends).

In [1]:
%%bash
pipdeptree | perl -nle'print if m{^\w+}'
anaconda-project==0.8.3
argh==0.26.2
asn1crypto==1.4.0
astropy==4.0.1.post1
autopep8==1.5.4
awkward1==0.2.35
backports.functools-lru-cache==1.6.1
backports.shutil-get-terminal-size==1.0.0
bitarray==1.4.2
bkcharts==0.2
boto==2.49.0
Bottleneck==1.3.2
brotlipy==0.7.0
bumpversion==0.5.3
cmarkgfm==0.4.2
Columnar==1.3.1
conda-build==3.19.2
conda-devenv==2.1.0
conda-package-handling==1.6.1
ConfigArgParse==1.2.3
contextlib2==0.6.0.post1
cookiecutter==1.7.2
Cython==0.29.21
cytoolz==0.10.1
datashader==0.11.0
distributed==2.22.0
fastcache==1.1.0
Flask==1.1.2
fsspec==0.8.0
gevent==20.6.2
glob2==0.7
gmpy2==2.1.0b1
google-api-python-client==1.10.0
graphviz==0.14.1
h5py==2.10.0
holoviews==1.13.3
html5lib==1.1
imagecodecs==2020.5.30
importlib-metadata==1.7.0
ipyparallel==6.3.0
itk-io==5.1.0.post3
itk-registration==5.1.0.post3
itk-segmentation==5.1.0.post3
itkwidgets==0.32.0
jupyter-console==6.1.0
jupyterlab==2.2.4
jupytext==1.5.2
lxml==4.5.2
mamba==0.4.4
mayavi==4.7.1
mkl-fft==1.1.0
mkl-random==1.1.0
mkl-service==2.3.0
mmf-setup==0.3.0
mmfutils==0.5.4.dev0
mock==4.0.2
nbdime==2.0.0
netCDF4==1.5.4
nltk==3.4.4
nose==1.3.7
nox==2020.8.22
oauth2client==4.1.3
olefile==0.46
openpyxl==3.0.4
paramnb==2.0.4
partd==1.1.0
path==15.0.0
pathlib2==2.3.5
pep8==1.7.1
persist==3.1.dev1
pipdeptree==1.0.0
ply==3.11
pycurl==7.43.0.5
pydocstyle==5.0.2
pyFFTW==0.12.0
pygraphviz==1.5
pyodbc==4.0.30
PyOpenGL==3.1.5
pyOpenSSL==19.1.0
PyQt5-sip==4.19.18
PyQtChart==5.12
PySocks==1.7.1
pytest-cov==2.10.0
pytest-flake8==1.0.6
pytest-xdist==1.34.0
pyvista==0.25.3
regex==2020.7.14
rope==0.17.0
Rtree==0.9.4
scikit-image==0.17.2
scikit-learn==0.23.2
seaborn==0.10.1
simplegeneric==0.8.1
simplejson==3.17.2
singledispatch==3.4.0.3
sip==4.19.24
snakeviz==2.1.0
sortedcollections==1.2.1
sphinx-rtd-theme==0.5.0
sphinxcontrib-websupport==1.2.4
sphinxcontrib-zopeext==0.2.4
spyder==4.1.4
SQLAlchemy==1.3.18
statsmodels==0.11.1
sympy==1.6.2
tables==3.6.1
tox==3.20.0
uncertainties==3.1.4
unicodecsv==0.14.1
Unidecode==1.1.1
vispy==0.6.4
vpython==7.6.1
wdata==0.1.0
wheel==0.34.2
whichcraft==0.6.1
xlrd==1.2.0
XlsxWriter==1.3.2
xlwings==0.20.2
xlwt==1.3.0
yapf==0.30.0
Warning!!! Possibly conflicting dependencies found:
* vpython==7.6.1
 - jupyter [required: Any, installed: ?]
* QDarkStyle==2.8.1
 - helpdev [required: >=0.6.10, installed: ?]
* mamba==0.4.4
 - pybind11 [required: >=2.2, installed: ?]
* itkwidgets==0.32.0
 - itk-meshtopolydata [required: >=0.6.2, installed: ?]
* applaunchservices==0.2.1
 - pyobjc [required: Any, installed: ?]
------------------------------------------------------------------------
In [9]:
from IPython.display import display, clear_output
import json, glob, sys
import os
from os.path import join, basename
# install this with "conda install -c conda-forge python-graphviz pygraphviz"
import graphviz as gv
import pygraphviz as pgv
import networkx as nx

# path to your conda environment
env_dir = os.path.dirname(sys.prefix)
env_name = os.path.basename(sys.prefix)
env_name = "cugpe"
path = os.path.join(env_dir, env_name)
path = os.path.dirname(env_dir)

path = "/data/apps/conda/envs/cugpe"
#path = "/data/apps/conda/envs/work"
#path = "/data/apps/conda/envs/blog"
#path = "/data/apps/conda/envs/hv_ok"
#path = "/data/apps/conda/envs/_gpe3"

dg = gv.Digraph(name=os.path.basename(path))
pdg = pgv.AGraph(strict=False, directed=True)
ng = nx.DiGraph()

for json_file in glob.glob(join(path, 'conda-meta', '*.json')):
    print('reading', json_file)
    j = json.load(open(json_file))
    name = j['name']
    label = "\n".join([j['name'], j['version']])
    attrs = dict()
    dg.node(name, label=label)
    pdg.add_node(name)
    ng.add_node(name)
    for dep in j.get('depends', []):
        _dep = dep.split(' ', 1)
        dep_name = _dep.pop(0)
        if _dep:
            attrs = dict(label=_dep[0])
        dg.edge(name, dep_name, **attrs)
        pdg.add_edge(name, dep_name, **attrs)
        ng.add_edge(name, dep_name, **attrs)
clear_output()
In [11]:
roots = sorted([(1+len(nx.descendants(ng, _n)), _n)
                for _n in ng.nodes() if ng.in_degree(_n) == 0])
roots
Out[11]:
[(17, 'python.app'),
 (20, 'argcomplete'),
 (30, 'conda-verify'),
 (30, 'mmf_setup'),
 (36, 'conda-tree'),
 (37, 'conda-devenv'),
 (41, 'twine'),
 (43, 'anaconda-client'),
 (47, 'mamba'),
 (56, 'conda-build')]
In [6]:
roots = sorted([(1+len(nx.descendants(ng, _n)), _n)
                for _n in ng.nodes() if ng.in_degree(_n) == 0])
roots
Out[6]:
[(17, 'python.app'),
 (18, 'backports.functools_lru_cache'),
 (19, 'backports.tempfile'),
 (20, 'argcomplete'),
 (24, 'conda-verify'),
 (30, 'mmf_setup'),
 (36, 'conda-tree'),
 (37, 'conda-devenv'),
 (43, 'anaconda-client'),
 (45, 'twine'),
 (50, 'mamba'),
 (52, 'python-graphviz'),
 (56, 'conda-build')]
In [10]:
dg.render(view=True)
Out[10]:
'blog.gv.pdf'

Issues

Conda Performance

Conda can be very slow to resolve dependencies. An experimental project mamba attempts to speed this up.

Redundancy between Conda and Pip

The present workflow duplicates information in setup.py for pip and PyPI, and meta.yaml for Conda. This is being discussed as part of the following Conda issue:

Disk Usage

Multiple Conda environments can use a lot of disk space. Some of this can be recovered by cleaning unused packages:

conda clean --all

however, packages that are currently being used can take a lot of space. One way to check is to run ncdu in the pkg directory:

$ ncdu /data/apps/conda/pkg
--- /data/apps/conda/pkgs --------------------------------
  581.6 MiB [##########] /itk-5.1.1-py38h32f6830_3                                                                          
  540.2 MiB [######### ] /mkl-2020.2-260
  314.0 MiB [#####     ] /qt-5.12.5-h514805e_3
  313.5 MiB [#####     ] /qt-5.12.5-h9272185_4
  164.5 MiB [##        ] /vtk-8.2.0-py38h3f69d5f_218
  118.6 MiB [##        ] /pandoc-2.10.1-haf1e3a3_0
  115.2 MiB [#         ] /pandoc-2.10-0
   88.6 MiB [#         ] /pandoc-2.11-h0dc7051_0
   84.3 MiB [#         ] /pandoc-2.11.0.4-h22f3db7_0
   84.1 MiB [#         ] /pandoc-2.11-h22f3db7_0
   ...

Here we see that there are two versions of qt being used, and multiple versions of pandoc. (This was after a bit of cleaning - previously I had several versions of itk and mkl as well.) To find out which environments are using which package, we can run the following:

function get_ver() {
  envs=$(conda env list --json | jq -r '.envs[]')
  for p in $envs; do
    echo "========================>" $p
    conda list -p $p | grep "\b$1\b"
  done
}
get_ver qt
========================> /data/apps/conda
========================> /data/apps/conda/envs/alcc
========================> /data/apps/conda/envs/app_gitannex
========================> /data/apps/conda/envs/blog
========================> /data/apps/conda/envs/hg
========================> /data/apps/conda/envs/jupyter
qt                        5.12.5               h9272185_4    conda-forge
========================> /data/apps/conda/envs/leo
========================> /data/apps/conda/envs/super_hydro
========================> /data/apps/conda/envs/work
qt                        5.12.5               h514805e_3    conda-forge

I can then upgrade the work and jupyter environment to make sure it uses the same package, thereby saving space:

mamba update -n work qt
mamba update -n jupyter qt

Caveats:

  • This might not always work if there are conflicts.
  • This can break libraries with numpy and scipy so test.
  • To pin a specific version, you might need to install rather than update:

    mamba install -n work qt=5.12.5=h9272185_4
    

After running conda clean --all again we have:

$ conda clean --all
$ ncdu /data/apps/conda/pkgs
  581.6 MiB [##########] /itk-5.1.1-py38h32f6830_3
  540.2 MiB [######### ] /mkl-2020.2-260
  319.6 MiB [#####     ] /qt-5.12.9-h717870c_0
  164.5 MiB [##        ] /vtk-8.2.0-py38h3f69d5f_218
...

Here is my typical usage on Mac OS X after such cleaning:

14.6 GiB /data/apps/conda/
   12.5 GiB [##########] /envs
        10.0 GiB [##########] /work
         2.3 GiB [##        ] /jupyter
         1.2 GiB [#         ] /alcc
         1.1 GiB [#         ] /super_hydro
       590.2 MiB [          ] /leo
       396.9 MiB [          ] /blog
       125.9 MiB [          ] /hg
       115.9 MiB [          ] /app_gitannex
       ...
    4.4 GiB [###       ] /pkgs
  548.1 MiB [          ] /conda-bld
  410.7 MiB [          ] /lib
   54.3 MiB [          ] /share
   24.8 MiB [          ] /include
   19.7 MiB [          ] /bin
    7.3 MiB [          ] /conda-meta
    4.3 MiB [          ] /python.app
...

Building a Conda Package

For a simple example of a Conda package, see the following:

This is a simple python project I forked consisting of a single python file. To turn it into a Conda package, I added the following meta.yaml YAML file, built, and uploaded it as described in Anaconda Cloud: Building Packages:

package:
  name: conda-tree
  version: "0.0.1"

source:
  git_rev: master
  git_url: https://github.com/mforbes/conda-tree.git

requirements:
  host:
    - python

  run:
    - networkx
    - conda

build:
  noarch: python
  script:    # See https://github.com/conda/conda-build/issues/3166
    - mkdir -p "$PREFIX/bin"
    - cp conda-tree.py "$PREFIX/bin/"

about:
  home: https://github.com/rvalieris/conda-tree
  license: MIT
  license_file: LICENSE

This follows a discussion about using conda-build to build a package without setup.py (since I wanted to minimally complicate the original package). Once this is built and committed, I can build it an uploaded to [my Conda channel'(https://anaconda.org/mforbes) as follows:

conda install conda-build anaconda-client  # If needed: I have these in (base)
anaconda login                             # If needed: I stay logged in
conda build .

# The name needed below can be found with
conda build . --output

anaconda upload /data/apps/anaconda/conda-bld/noarch/conda-tree-0.0.1-0.tar.bz2

One gotcha: the conda build . command above will attempt to download the source from the appropriate tag/branch on Github (since that is what we specified as a source). Thus, you must make sure to tag and push those tags:

git tag -a v0.0.1
git push v0.0.1

When a Dependency is not Available to Conda

When you are making conda packages, all elements need to be conda-installable. Here is how to push a pip-installable package to your conda channel:

mkdir tmp; cd tmp
conda activate base
conda skeleton pypi husl
# Edit husl/meta.yaml if needed
conda build husl/meta.yaml
anaconda upload --all /data/apps/conda/conda-bld/osx-64/husl-4.0.3-py37_0.tar.bz2
conda skeleton pypi python-hglib
# Edit python-hglib/meta.yaml if needed
conda build python-hglib/meta.yaml
anaconda upload --all /data/apps/conda/conda-bld/osx-64/python-hglib-2.6.1-py37_0.tar.bz2

References

Testing

By including a section like the following, you can run tests when you issue the conda build command. Some important notes though:

  • Conda now moves the working directory, so you need to specifically include the files you will test with the source_files: section.
  • If you build from your source directory, be sure to clean out __pycache__ directories (see Gotchas below).
test:
  source_files:
    - persist
  imports:
    - persist
  requires:
    - coverage
    - h5py
    - pytest >=2.8.1
    - pytest-cov >=2.2.0
    - pytest-flake8
    - scipy
  commands:
    - py.test

This will do several things:

  1. It will test that import perists works.
  2. It will create a test environment with the specified requirements.
  3. It will run py.test.

If you do this locally (i.e. src: .) then be sure to remove all __pycache__, *.pyc, and *.pyo files:

find . -name "__pycache__" -exec rm -rf {} \;
find . -name "*.pyc" -delete
find . -name "*.pyo" -delete

Gotchas

  • Make sure you have the appropriate channels in your ~/.condarc file. (There is currently no way to specify channels for conda build.)

    channels:
      - defaults
      - conda-forge
      - mforbes
      - file://data/apps/conda/conda-bld
    
  • The last entry is because sometimes things are not immediately available on my mforbes channel, even though I upload something to anaconda.org. This is where they are built by default. This local channel can be made available by running:

    conda index /data/apps/conda/conda-bld
    
  • Don't run conda build from a conda environment. Make sure you are in the base environment.

  • If you do this locally (i.e. src: .) then be sure to remove all __pycache__, *.pyc, and *.pyo files:

    find . -name "__pycache__" -exec rm -rf {} \;
    find . -name "*.pyc" -delete
    find . -name "*.pyo" -delete
    

Current Working Environments

I keep track of my working environments through a set of environment.*.yml files which I host here:

Complete Install (21 July 2018)

Here is an example of a complete install on Mac OS X.

In [ ]:
 
In [ ]:
%%file environment.base.yml
channe
conda create -n work python=2
conda install -n work pandoc anaconda argcomplete  beautiful-soup  colorcet  dill  distribute mercurial pep8\
                      pyaudio  pycrypto  pympler  pytest-runner sphinx_rtd_theme  ujson cvxopt futures-compat\
                      lancet mkl-service  pycurl bottleneck uncertainties mklfft mock scikit-learn twine weave\
                      snakeviz sympy pillow xarray pytest-cov pylint plotly vispy urllib3 numpydoc  pytest-flake8\
                      line_profiler pygraphviz seaborn ipyparallel nbsphinx  nbtutor paramnb nbdime jupyter\
                      jupyter_contrib_nbextensions

References

Old Notes Etc.

TL:DR

  • Install miniconda with perhaps a few tools like mercurial, but use conda create -n <env> to create working environments to help maintain isolation for everything else.
  • Create the environments from an environment.yml file for reproducibility.

    • Make sure that pip is configured to not install packages in the user directory so that they instead go to the conda environments:

      pip config set install.user false
      

This setup requires activating the appropriate conda environment before working. There are three options for making commands available to all environments:

  • Added the base miniconda bin/ at the end of your path in a special way so that special way so that you can fall back to these base commands. I do this for mercurial which I install in my base environment.
  • Explicitly use pip install --user which will put files in ~/.locals/bin and ~/.locals/lib so that any current python environment can access them. I do this with Nikola for blogging.
  • Create symlinks to conda-installed executables in ~/.locals/bin or aliases to the appropriate environment. I use this, for example, with Jupyter.
In [ ]: