distutils woes - help appreciated!

Tushar Wagle tushar at hursley.ibm.com
Sat Jul 7 00:25:48 CEST 2001

Hello all,

I'm starting-to-try-to-use (:) distutils (with Python 2.1 on Linux).

For basic stuff, it's okay (and rather cool :), but I have a few


1. scripts:

Can I install a script in a directory OTHER than /usr/local/bin?

I'm hoping for an option like "script_dir='/usr/local/my_stuff'"

(similar to 'package_dir').

2. data_files

I can't get this to work at all!

I'm using something like:


        package_dir={'': 'src'},
        packages=['jim', 'jim.data', 'jim.report', 'jim.web'],

        data_files=[('/x/website/htdocs/styles', ['src/web/styles/basic.css',])]


where /x/website/htdocs is where I want to place my data files, and src/...

is where the source file lives. (I tried removing the src/ , hoping that

it might sensibly use the package_dir root, but to no avail.. :(

Again, I would like to see something like 'data_dir' (cf 'package_dir')...

It would be nice if script_dir and data_dir defaulted to package_dir (at

least for my purposes where everything's under the src/ directory :)

On a related note, I had tried something like:

    web_root = '/x/website'


        data_files=[(web_root + 'styles', os.listdir('./src/web/styles'))],


but it looked like this couldn't work as the listdir was running inside the

temporary 'build' directory, and all of my source files had NOT been copied there!!

(I think it just copied the packages?...). Can I refer to the real source root

directory somehow (ie rather than './')?

3. re-targetting dist-dir

changing dist-dir (eg to 'release') works okay (files end up there correctly), but

the 'dist' directory is always created nevertheless (and source rpms seem to end up there)!...

...I presume this is a bug! :)


Other than these niggles, I'm impressed! As always with Python, what's normally

a task which generates headaches and wastes many hours unproductively is simply

and elegantly resolved...for the better of the Universe as a Whole! %-)

Best Regards,


(Python Beginner/Evangelist/Devotee! ;)

More information about the Python-list mailing list