PyCon/2014-translation

Translate: "Notes for Tutorial Preparation"

Closed this issue · 1 comments

General installation help: 6:30-8:00PM Tuesday & Wednesday in Open Spaces.

If you want to help others prepare for their Tutorial Installations at PyCon, here are some basic guidelines.

Assume no network

Assume there may not be any network available.

Use virtualenv

Normally, you want to setup using virtualenv (assume people will take more than one tutorial), however there are some packages that will not install easily under virtualenv (pygame, for example; potentially some other packages which require your compilation environment and dependencies). If you're going to use virutalenv, it would look something like this for example:

    mkdir -p PyCon2013/tutorials/django
    cd PyCon2013/tutorials/django
    virtualenv --no-site-packages Vdjango

Since virtualenv typically modifies the shell prompt to show which environment your operating under, pick a meaningful name. I typically start all v-env's with "V" or "E" (so they show together in a directory listing).

People may want to add this to their bash login script:

    activate() # for python virtualenv
    {
        source "$*"/bin/activate
    }

It may help newcomers, as it makes the idioms for virtualenv a little more symmetrical and thus easier to remember, e.g.:
     mkvirtualenv Vsomename
     activate Vsomename
     ... do stuff ...
     deactivate

Once your virtualenv is activated, you can begin installing into it. ### **Install from USB**

Prepare your packages for USB Install (not from the network):

    MY_USB = /path/to/usb
    pip install -d $MY_USB/pkgs -r requirements.txt

Install from your own USB:
    pip install --find-links=file://$MY_USB/pkgs --no-index -r requirements.txt

You don't need to use a _requirements.txt_ file; you can simply load packages individually by name, if that is more convenient. ### **Ubiquitous USB**

When downloading binary packages, whenever possible save for 3 platforms on your USB (Linux, Mac, Win).

So that all the USBs floating around Tutorial Prep nights look the same, follow this pattern:

  • USB top level directory pkgs - for python packages
  • USB top level directory lin, mac, win - for platform specific archives
  • USB top level directory requirements - pip requirements files, by course (e.g.: requirements/django.txt)