Dedicado a Katai ^.^”
Teniendo Python 2.4 instalado, vamos a proceder a realizar un virtualenv:
Virtual Python Environment builder:
virtualenv is a successor to workingenv, and an extension of virtual-python.
What it Does?:
virtualenv is a tool to create isolated Python environments.
A lo bestia, digamos que virtualenv es un ‘chroot’ de la instancia python que vamos a utilizar para trabajar. Mas data Aqui
Creando un Python ‘Virtual’:
Si estas en un sistema Linux, BSD, Cygwin o algun otro de OS de tipo UNIX y no tienes acceso de root, puedes crear tu propia instalacion ‘virtual’ de python, cual utiliza sus propias librerias y enlaza algunas otras con las librerias de python del sistema.
Proseguimos descargando virtual-python.py:
bash-3.1$ wget http://peak.telecommunity.com/dist/virtual-python.py
Lo instalamos:
bash-3.1$ mkdir ~/.vpython
bash-3.1$ python2.4 virtual-python.py –help
usage: virtual-python.py [options]options:
-h, –help show this help message and exit
-v, –verbose Increase verbosity
–prefix=PREFIX The base directory to install to (default ~)
–clear Clear out the non-root install and start from scratch
–no-site-packages Don’t copy the contents of the global site-packages dir
to the non-root site-packagesbash-3.1$ python2.4 ./virtual-python.py –prefix=/home/lain/.vpython
Creating /home/lain/.vpython/lib/python2.4
Creating /home/lain/.vpython/lib/python2.4/site-packages
Creating /home/lain/.vpython/include/python2.4
Creating /home/lain/.vpython/bin
Copying /usr/local/bin/python2.4 to /home/lain/.vpython/bin
You’re now ready to download ez_setup.py, and run
/home/lain/.vpython/bin/python ez_setup.py
bash-3.1$
Ok, vamos a correr ez_setup.py (easy_install) mas datos Aqui
bash-3.1$ /home/lain/.vpython/bin/python ez_setup.py
Downloading http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c8-py2.4.egg
Processing setuptools-0.6c8-py2.4.egg
creating /home/lain/.vpython/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg
Extracting setuptools-0.6c8-py2.4.egg to /home/lain/.vpython/lib/python2.4/site-packages
Adding setuptools 0.6c8 to easy-install.pth file
Installing easy_install script to /home/lain/.vpython/bin
Installing easy_install-2.4 script to /home/lain/.vpython/binInstalled /home/lain/.vpython/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg
Processing dependencies for setuptools==0.6c8
Finished processing dependencies for setuptools==0.6c8
Proseguimos con nuestra meta, estamos en condiciones de instalar virtualenv!
bash-3.1$ ~/.vpython/bin/easy_install-2.4 virtualenv
Searching for virtualenv
Best match: virtualenv 1.1
Processing virtualenv-1.1-py2.4.egg
virtualenv 1.1 is already the active version in easy-install.pth
Installing virtualenv script to /home/lain/.vpython/binUsing /home/lain/.vpython/lib/python2.4/site-packages/virtualenv-1.1-py2.4.egg
Processing dependencies for virtualenv
Finished processing dependencies for virtualenv
bash-3.1$
Ahora a crear nuestro python environment!
bash-3.1$ mkdir ~/.pyenv
bash-3.1$ ~/.vpython/bin/virtualenv ~/.pyenv
New python executable in /home/lain/.pyenv/bin/python
Installing setuptools………….done.
Voila! terminamos
bash-3.1$ ~/.pyenv/bin/python
Python 2.4.4 (#1, Jun 15 2008, 17:41:52)
[GCC 4.2.3] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>>
El sabor de la victoria! ^.^”
Ahora podemos crear tantos pyenv como queramos en nuestro sistema y utilizar cada uno independientemente en nuestros proyectos
.
pd: bue … tmb dedicado a dergerk … derberk … derrr … dererk ~.~”
[...] the Python Imaging Library deberia ser instalado con nuestro interprete. Cuando vimos como crear un virtual python environment al final del articulo logramos tener un interprete de python: bash-3.1$ ~/.pyenv/bin/python Python [...]