distutils install dir

J

John Hunter

What is the best way to get the target install dir from distutils when

python setup.py install

is run.

Eg, on a standard python install to /usr/local I want

/usr/local/lib/python2.3/site-packages

and on a standard win32 python installation I want
c:\\Python23\\Lib\\site-packages

I also want to handle the case when an alternate prefix is installed.

To to ask the question another way. I want to add SomeFile.pth to the
install dir. For various reasons, extra_path is not a good choice for
me. I just want to copy a file SomeFile.pth to the site-packages dir.
My workaround is to treat SomeFile.pth as a data_file, and add it to
the site-packages dir (stored in sitep) with

data_files = [ (sitep, 'SomeFile.pth') ]


setup(name="somemod",
..snip...
ext_modules = ext_modules,
data_files=data_files,
)

Thanks,
John Hunter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top