You must be in the 'staff' group (allows you to write /usr/local/
tree).
First install python2.4: sudo apt-get install python2.4-dev
Next, create: ~/.pydistutils.cfg
cat > ~/.pydistutile.cfg << EOF
[install]
install_lib = /usr/local/lib/python$py_version_short/site-packages
EOF
Now the install will work without being root.
python2.4 ez_setup.py -f http://www.turbogears.org/download/index.html
--script-dir /usr/local/bin TurboGears
--gh
[p.s. Kevin ... sorry about previously spamming you with the same
message ... laziness ... too much perl.]
The previous works fine for installation but "kid" won't run.
I created ~/py/sitecustomize.py
cat > py/sitecustomize.py <<EOF
import sys, os, os.path
setuptools_dir = '/usr/local/lib/python2.4/site-packages'
for x in os.listdir(os.path.expanduser(setuptools_dir)):
eggpath = os.path.join(setuptools_dir, x)
if x.endswith('.egg') and os.path.isdir(eggpath):
sys.path.insert(0, eggpath)
EOF
and used:
export PYTHONPATH=~/py:/usr/local/lib/python2.4
and now "kid" runs.
--gh
[python newbie ... :-)]
I strongly recommend that people *not* do this! You will prevent
easy_install from being able to work correctly with your installation
in the future!
Setuptools 0.6a6 supports installation to almost any directory using
PYTHONPATH if you want to do it that way, and it also includes a script
to setup a virtual Python if you prefer using that approach. But you
will need to get rid of the above cruft.
For the correct non-root installation instructions for 0.6a6, please
see:
Or better yet, just use this script to create a ~/bin/python that will
do everything as it should:
http://peak.telecommunity.com/dist/virtual-python.py
It should work even with setuptools 0.6a5.
I strongly recommend that you get rid of the sitecustomize.py and the
/usr/local stuff you did, and use either the virtual-python script or
upgrade to setuptools 0.6a6 from CVS.
Please, don't anybody else do what's described here - easy_install will
NOT work properly if you do this. Somebody posted these broken
instructions to the Wiki, but I got distracted working on 0.6a6 and
forgot to delete them from the Wiki. I've now added a warning to the
wiki page that you should BACK OUT these steps if you've done them.
Use the virtual-python script or use 0.6a6; those are the only safe
choices.
Partly. If you want to be able to use easy_install with it, you should
also add this to your ~/.pydistutils.cfg:
[easy_install]
site-dirs = /usr/local/lib/python2.4/site-packages
Doing this should then eliminate the need for the sitecustomize.py
hack, because then easy_install can set an "active" version of a
package.
Assuming that Debian is adding the
/usr/local/lib/python2.4/site-packages directory to sys.path, then this
should be all you need. You should not even need to set PYTHONPATH; it
should Just Work, as long as you rerun easy_install on the packages
you've already installed, so it sets them as the active versions. (It
won't need to re-download them, it'll just add them to a .pth file.)
I should probably add some notes about this Debian-specific issue to
EasyInstall.txt, but of course that would increase its length. ;)