The Artima Developer Community
Sponsored Link

Python Buzz Forum
Alternate Python Install Directory

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ian Bicking

Posts: 900
Nickname: ianb
Registered: Apr, 2003

Ian Bicking is a freelance programmer
Alternate Python Install Directory Posted: Oct 7, 2005 1:14 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ian Bicking.
Original Post: Alternate Python Install Directory
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ian Bicking
Latest Posts From Ian Bicking

Advertisement

So, I started experimenting with setting up an alternate location for installing files. Using FreeBSD, all libraries go into /usr/local/lib/pythonX.Y/site-packages by default (no /usr/lib/pythonX.Y). That includes packages installed by ports (FreeBSD's packaging system).

But we're creating an alternate hierarchy for our systems, and I've started thinking this should include multi-version software installation (things installed through a packaging system will still go wherever the packager wants them to go). Eggs don't map terribly well to most packaging systems, as packaging systems don't support multiple versions and "active" versions of software well. Eggs do support these things, and moreso these features are really important to the way we deploy software.

So it wasn't too hard... first, I made /usr/local/lib/python2.4/site-packages/sitecustomize.py, that looks like:

import site
import sys

site.addsitedir("/iscape/lib/python%s.%s/site-packages"
                % (sys.version_info[0], sys.version_info[1]))

Then I created a file /usr/local/lib/python2.4/distutils/distutils.cfg:

[install]
prefix = /iscape

[easy_install]
find_links = http://host.name/package_archive/
             http://pythonpaste.org/package_index.html
install_dir = /iscape/lib/python%(version)s/site-packages
site_dirs = /iscape/lib/python%(version)s/site-packages

Substituting %(version)s with the respective Python version, of course (though we're primarily using 2.4, especially for our own software).

Now I can install our internal packages to a directory /package_archive/ (and just let Apache create the HTML index of that directory), and easy_install.py PackageName will install into /iscape/lib/.

Especially until such time as easy_install.py (or probably another to-be-written tool called nest) does package management (listing and deleting installed versions of software) this will keep all our eggs together and easy to manage.

Read: Alternate Python Install Directory

Topic: JSLint from the Command Line Previous Topic   Next Topic Topic: SQLObject 0.7b1

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use