[albatross-users] Installing multiple copies of Albatross

Dave Cole djc at object-craft.com.au
Fri Jul 4 09:49:03 EST 2003


>>>>> "Gregory" == Gregory Bond <gnb at itga.com.au> writes:

Gregory> No, the Albatross code is full of references to "from
Gregory> albatross.module import" so you'll need to change them, too.
Gregory> You should be able to change this to just "from module import
Gregory> " and the Python module path hacking will DTRT.

Gregory> Dave: you might consider making Albatross not use the
Gregory> "albatross" name internally so tricks like this work.

Albatross used to use relative imports until we discovered that
relative imports are frowned upon.

   From http://www.python.org/peps/pep-0008.html

    - Relative imports for intra-package imports are highly
      discouraged.  Always use the absolute package path for all
      imports.

One thing that Andrew has done with good results is install the
desired release of Albatross in the application directory.  Most of
the time Python has the current directory as the first entry in
sys.path.

If you are running a mod_python application then you will probably
have to manually change sys.path.

    import sys
    sys.path.insert(0, '/path/to/my/special/albatross')
    import albatross

Since the module is only imported once by Apache the above should be
OK.  You might also consider telling mod_python to run a separate
interpreter instance for each directory.

    http://www.modpython.org/live/mod_python-2.7.8/doc-html/pyapi-interps.html

- Dave

-- 
http://www.object-craft.com.au




More information about the Albatross-users mailing list