title: Scripting virtualenvwrapper mkvirtualenv
body: <p>I'm writing a <a href="http://github.com/greenmoss/NotOrion" rel="nofollow noreferrer">game</a> in python 2.7, and want to script the "bootstrap" of my game's development environment, and then invoke <a href="https://github.com/seomoz/shovel" rel="nofollow noreferrer">shovel</a>. If virtualenvwrapper is not detected, I will use a <a href="https://stackoverflow.com/questions/4324558/whats-the-proper-way-to-install-pip-virtualenv-and-distribute-for-python">virtualenv bootstrap solution</a>. However if virtualenvwrapper <strong>is</strong> detected, I would like to use it instead.</p>
  
  <p>The problem is that the virtualenvwrapper inline shell functions are not inherited by my bootstrap script. As far as I know, that rules out running something like "mkvirtualenv NotOrion". Since the environment variable "VIRTUALENVWRAPPER_VIRTUALENV" <strong>is</strong> set (in my case, from <a href="http://www.macports.org/ports.php?by=name&amp;substr=virtualenvwrapper" rel="nofollow noreferrer">macports</a>: <code>/opt/local/bin/virtualenv-2.7</code>), I tried using it directly instead:</p>
  
  <pre><code>#!/usr/bin/env bash
  
  # Name your first "bootstrap" environment:
  ENV_NAME=NotOrion
  # Options for your first environment:
  ENV_OPTS='--no-site-packages --distribute'
  
  unset PYTHONDONTWRITEBYTECODE
  
  function create_virtualenvwrapper_venv {
    echo "installing into virtualenvwrapper directory"
    cd $WORKON_HOME
    $VIRTUALENVWRAPPER_VIRTUALENV $ENV_OPTS $ENV_NAME
    cd -
    #mkvirtualenv $ENV_NAME
    #workon $ENV_NAME
  }
  
  function create_standalone_venv {
    # not run/snipped
  }
  
  if [ -z "$VIRTUALENVWRAPPER_VIRTUALENV" ]; then
    create_standalone_venv
  else
    create_virtualenvwrapper_venv
  fi
  
  pip install shovel
  shovel help
  </code></pre>
  
  <p>My bootstrap script finishes installing shovel. However running shovel (eg the last line) produces warnings:</p>
  
  <pre><code>/Users/me/.virtualenvs/NotOrion/bin/shovel:25: UserWarning: Module argparse was already imported from /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/argparse.pyc, but /Users/me/.virtualenvs/NotOrion/lib/python2.7/site-packages is being added to sys.path
  import pkg_resources
  # normal shovel output snipped
  </code></pre>
  
  <p>So is it possible to somehow invoke "mkvirtualenv" from a script? If not, can I run something else from my script that has the same effect but <strong>doesn't</strong> produce warnings?</p>