Question on using distutils.core.run_setup

Discussion in 'Python' started by Terry Jones, Mar 17, 2008.

  1. Terry Jones

    Terry Jones Guest

    I'm trying to programmatically install something built using distutils. I
    found distutils.core.run_setup and can use it via

    >>> dist = run_setup('setup.py', ['-q', 'install'])


    Is that the recommended way to do an install from inside Python (as opposed
    to doing it on the command line)?

    If so, how can I find where the thing(s) I installed now resides? I saw
    dist.packages but that just has top-level package names. I could __import__
    these (and then use module.__file__), but that's not a good solution as it
    may run code I don't want run. On my machine, I can see the packages have
    been installed under the system's python2.5/site-packages directory. But
    how can I determine that programmatically? I don't see anything useful on
    the distutils.dist.Distribution instance I'm getting back from run_setup.

    Thanks!

    Terry
    Terry Jones, Mar 17, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kent Tenney
    Replies:
    4
    Views:
    2,788
    David M. Cooke
    Jul 21, 2003
  2. Tristan Miller
    Replies:
    1
    Views:
    651
    Tristan Miller
    Jul 23, 2004
  3. timw.google
    Replies:
    1
    Views:
    519
    Serge Orlov
    May 11, 2006
  4. Luis Alberto Zarrabeitia Gomez

    distutils, No module named numpy.distutils.fcompiler.conv_template

    Luis Alberto Zarrabeitia Gomez, Mar 30, 2009, in forum: Python
    Replies:
    0
    Views:
    1,288
    Luis Alberto Zarrabeitia Gomez
    Mar 30, 2009
  5. j vickroy
    Replies:
    5
    Views:
    1,806
    j vickroy
    Nov 6, 2009
Loading...

Share This Page