Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > how to find site-packages path

Reply
Thread Tools

how to find site-packages path

 
 
Philippe C. Martin
Guest
Posts: n/a
 
      01-17-2005
Hi,

I am using my own install script for my software and am looking for a
flawless way to figure out where python, and more specifically
site-packages is installed.

Any clue ?

Regards,

Philippe



--
***************************
Philippe C. Martin
SnakeCard LLC
www.snakecard.com
***************************

 
Reply With Quote
 
 
 
 
vincent wehren
Guest
Posts: n/a
 
      01-17-2005
Philippe C. Martin wrote:
> Hi,
>
> I am using my own install script for my software and am looking for a
> flawless way to figure out where python, and more specifically
> site-packages is installed.


You can take a look at how this is done in Lib/site.py.

Look for the bit of code that starts with

prefixes = [sys.prefix]
sitedir = None # make sure sitedir is initialized because of later 'del'
....

etc.

--
Vincent Wehren


>
> Any clue ?
>
> Regards,
>
> Philippe
>
>
>

 
Reply With Quote
 
 
 
 
Michael Hoffman
Guest
Posts: n/a
 
      01-17-2005
Philippe C. Martin wrote:

> I am using my own install script for my software and am looking for a
> flawless way to figure out where python, and more specifically
> site-packages is installed.


The flawless way would be to use distutils. In fact you shouldn't even
need your own install script--it should do most of the work for you.
--
Michael Hoffman
 
Reply With Quote
 
Eric S. Johansson
Guest
Posts: n/a
 
      01-18-2005
Michael Hoffman wrote:
> Philippe C. Martin wrote:
>
>> I am using my own install script for my software and am looking for a
>> flawless way to figure out where python, and more specifically
>> site-packages is installed.

>
>
> The flawless way would be to use distutils. In fact you shouldn't even
> need your own install script--it should do most of the work for you.


can distutils install in any directory? for example, an application
which has its own modules should be completely isolated from the general
Python module namespace. how would you make distutils install in a
completely separate directory hierarchy and not touch any of the
site-packages directories or files?

it looked like that was impossible from the documentation which is why I
wrote my own installer.

---eric

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to exclude action of Find::Find::find in subdirectories withknown names? vdvorkin Perl Misc 3 02-14-2011 05:28 AM
How to exclude action of Find::Find::find in subdirectories withknown names? vdvorkin Perl Misc 0 02-10-2011 05:18 PM
Find.find does not find orphaned links? Wybo Dekker Ruby 1 11-15-2005 02:50 PM
Bizzare: Invalid path to Access mdb, path is good Keith-Earl ASP .Net 1 05-03-2004 03:25 PM



Advertisments