Login
     
 
     
Articles:
List of all articles
List by categories
Search in articles
>> admin_tools
>> c
>> cli
>> database
>> debian
>> games
>> gnu
>> hardware
>> internet
>> linux
>> microsoft
>> network
>> os
>> php
>> programming
>> python
>> security
>> server
>> shell
>> text_editor
>> tools
>> web_dev
Links:
List all links
List by categories
Search in links
Online Tools:
>> gnuvd
Other Things:
Login
Admin
Pages
Blog
News
Guestbook
Contact
Sponsors:
None Yet!
Sponsor this project
That's not a published item! You are not allowed to see the content of this item!
[ Source ]

python easy install

Created: 2008-02-14 18:01:00
Modified: 2008-11-24 01:02:00
Categories: python programming
Keywords: python easy_install
Description:

This page talk about easy_install. The python way to install python modules.

Introduction

easy_install included in python setuptools, make it easy to manage new python packages. With this tool it is very easy to install new modules from the net and remove it of the system.

Download eggs

easy_install -H None -f SomeDir SomePackage

Install downloaded eggs

And then install the eggs manually with:

easy_install -zmaxd SomeDir SomePackage

Uninstall an egg

easy_install -m SomePackage

You want maybe to remove the traces (eggs) leaved on the system in /usr/lib/python2.X/site-packages/. Only the reference to the egg in /usr/lib/python2.X/site-packages/easy-install.pth is removed.

Where is the stuff installed?

For installed python stuff, checkout:

  • /usr/lib/python2.4/site-packages
  • /usr/share/python-support/

Set up a local python environment with virtual-python.py

See also the docs on my pyguicms-trac as this use this non-root install for the pyguicms install.

In this example, i install TurboGears with all his dependencies.

wget http://peak.telecommunity.com/dist/virtual-python.py
python virtual-python.py

And this output:

Creating /home/david/lib/python2.4
Creating /home/david/lib/python2.4/site-packages
Creating /home/david/include/python2.4
Creating /home/david/bin
Copying /usr/bin/python to /home/david/bin
You're now ready to download ez_setup.py, and run
/home/david/bin/python ez_setup.py

Like python-setuptools (easy_install) was already installed, i did not install it twice.

export PYTHONPATH=/home/david/lib/python2.4/site-packages

Set maybe the PYTHONPATH in the shell startup file.

touch /home/david/lib/python2.4/site-packages/easy-install.pth

easy_install --install-dir=/home/dvanmosselbeen/lib/python2.4/site-packages \
--script-dir=/home/dvanmosselbeen/bin TurboGears

Sometimes you get an error, because it didn't find a mirror or the mirror responded to late. Just run the command again.

To install some specific version:

Say that you want to get the latest stable version of TurboGears:

easy_install --install-dir=/home/dvanmosselbeen/lib/python2.4/site-packages \
--script-dir=/home/dvanmosselbeen/bin "setuptools>=0.6c5"

easy_install --install-dir=/home/dvanmosselbeen/lib/python2.4/site-packages \
--script-dir=/home/dvanmosselbeen/bin "TurboGears==1.0.7"

To upgrade some package:

To get the latest TurboGears version (1.1 beta at this time):

easy_install --upgrade --install-dir=/home/dvanmosselbeen/lib/python2.4/site-packages \
--script-dir=/home/dvanmosselbeen/bin TurboGears

Note that i had need to install/upgrade setup tools first! Easy install will inform you if needed.

Note: sqlobject is not installed, so install it:

easy_install --install-dir=/home/david/lib/python2.4/site-packages sqlobject

You can now test if everythings is working like expected:

/home/david/lib/python2.4/site-packages/tg-admin quickstart tester

For more informations see the easy_install docs.

Install a new version of setuptools

When i some troubles with utf8 and sqlobject ... I had need to install the latest mysql-python this failed with the mention to install the latest setuptools >=0.6c5 package. But installing this with easy_install wasn't possible as the program is in use.

Download the latest setuptools from http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c9.tar.gz#md5=3864c01d9c719c8924c455714492295e

Extract it:

    tar xf setuptools-0.6c9.tar.gz

cd setuptools-0.6c9/

export PYTHONPATH=/home/dvanmosselbeen/lib/python2.4/site-packages
python setup.py install --prefix ~

~/bin/easy_install --install-dir=/home/dvanmosselbeen/lib/python2.4/site-packages \ 
    --script-dir=/home/dvanmosselbeen/bin mysql-python

Set up a local python environment with virtualenv

Source from http://pypi.python.org/pypi/virtualenv.

For this we plans to use python 2.5 on our stable Debian GNU/Linux Etch box. I even create a new user called py25 who will own all this stuff. Later, we can add some users to the py25 group.

aptitude install python2.5 python2.5-dev

Download manually the needed virtualenv.py as Etch doesn't have this packaged. Lenny has this:

wget http://svn.colorstudy.com/virtualenv/trunk/virtualenv.py

cd ~
python2.5 virtualenv.py ENV

This output:

New python executable in ENV/bin/python2.5
Also creating executable in ENV/bin/python
Installing setuptools...........................done.

Using this new environment

source ENV/bin/activate

Your prompt should be now (ENV)py25@jupiter:~$ while it was py25@jupiter:~$

If you now enter python in the cli, you will see that it use python version 2.5.

Installing some stuff with easy install:

easy_install "TurboGears==1.1b1"

This automatically install stuff in /home/py25/ENV/lib/python2.5/site-packages/. As i installed TG, tg-admin is created in ENV/bin/.

Resources

Comments leaved by users (total: 0)

No comments yet!

Add a comment

obfuscated letters
 
  • Do you know that you may use some special markup syntax to create header, italic, bold, styling and links and much more. See the sandbox for the markup language.
  • Do you need some other help?

[ Toggle on/off history ]

Item History:

128 | 2008-11-24 01:06:54 | view diff
Added chapter "Install a new version of setuptools"

Login:
User Name
Password

Last Articles
python stuff concerning python
2009-07-22 12:00:00
vim
2009-06-06 23:53:00
fluxbox
2009-05-23 12:42:00
setting up a toshiba satellite a110-178
2009-05-21 15:35:00
create a secure virtual private network with openvpn
2009-04-25 13:34:00
>>> Read more...

Last News
Released pyguicms 1.0.0-beta1
2008-06-02 21:20:00
guicms replaced by pyguicms
2008-04-27 17:39:00
pyguicms up and running and online
2007-11-29 22:31:00
>>> Read more...

Last Links
mxtoolbox
2009-09-25 17:54:00
minibikeshop
2009-09-05 12:43:00
magicbike
2009-09-05 12:40:00
systranet
2009-07-22 11:42:00
transfer big files
2009-07-22 11:42:00
>>> Read more...

Last Pages
sandbox
2008-09-07 22:30:00
about
2008-09-07 22:29:00
help
2008-09-07 22:25:00
welcome page
2008-09-07 18:27:00
python stuff to check
2007-12-03 00:16:00
>>> Read more...