What is Virtualenv & Pip ? Environment : Install Virtualenv on windows (Linux is easy) Exercise 1: Create own environment using virtualenv Exercise 2: Learn pip command Exercise 3: Create own Pip package Exercise 4: Make scripts runnable directly Bonus Exercise: Share your scripts outside !!!! Exercise are created by me, and some introduction slides are copied from http://www.slideshare.net/webdebs/virtualenv-12727213
? (download & python setup.py install) How to use different python versions (2.6,2.7,3.x..)? How to install different packages (0.2,0.3.) How to test some packages without ruin the system How to delivery your python codes to other ? How to verify them ? … Python Virtualenv & Pip in 90 minutes 3
a tool for installing and managing Python packages It’s a replacement for easy_install. PyPi (Python Pakage Index) is a repository of software for Python and currently count 33429 package https://pypi.python.org/pypi Virtualenv is a tool to isolate your python environment Python Virtualenv & Pip in 90 minutes 4
even version live in their own planet :) Permissions - No sudoers, the environment is mine!!! Organization - each project can maintain its own requirements file of Python packages. No-Globalization – don’t require installing stuff globally on the system. Python Virtualenv & Pip in 90 minutes 6
hello.py under hello folder print “hello world” Write a setup.py from distutils.core import setup setup(name=‘hello', version=‘0.0.1', py_modules=[‘hello'], ) Package and install $ python setup.py sdist $ pip install dist/hello.0.0.1.zip $ find ~/venv | grep hello Change version to “0.0.2” and do it again Python Virtualenv & Pip in 90 minutes 9 http://docs.python.org/2/distutils/introduction.html