Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How to get directory of Python C library
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
arve.knudsen@gmail.com  
View profile  
 More options Nov 15, 12:56 pm
Newsgroups: comp.lang.python
From: "arve.knud...@gmail.com" <arve.knud...@gmail.com>
Date: Sun, 15 Nov 2009 09:56:56 -0800 (PST)
Local: Sun, Nov 15 2009 12:56 pm
Subject: How to get directory of Python C library
Hi

I need to link against Python, is there a way to get the path to the
directory containing Python's C library (e.g., <exec-prefix>/libs on
Windows)?

Thanks,
Arve


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diez B. Roggisch  
View profile  
 More options Nov 15, 2:05 pm
Newsgroups: comp.lang.python
From: "Diez B. Roggisch" <de...@nospam.web.de>
Date: Sun, 15 Nov 2009 20:05:48 +0100
Local: Sun, Nov 15 2009 2:05 pm
Subject: Re: How to get directory of Python C library
arve.knud...@gmail.com schrieb:

> Hi

> I need to link against Python, is there a way to get the path to the
> directory containing Python's C library (e.g., <exec-prefix>/libs on
> Windows)?

Most probably from the registry somehow. In general, try & locate a
python-executable, and make it execute

  python -c "import sys; print sys.prefix"

Capture that, and you're done. Depending on the OS, the libs then are
placed in e.g. <prefix>/lib.

Diez


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
arve.knudsen@gmail.com  
View profile  
 More options Nov 15, 3:14 pm
Newsgroups: comp.lang.python
From: "arve.knud...@gmail.com" <arve.knud...@gmail.com>
Date: Sun, 15 Nov 2009 12:14:59 -0800 (PST)
Local: Sun, Nov 15 2009 3:14 pm
Subject: Re: How to get directory of Python C library
On 15 Nov, 20:05, "Diez B. Roggisch" <de...@nospam.web.de> wrote:

> arve.knud...@gmail.com schrieb:

> > Hi

> > I need to link against Python, is there a way to get the path to the
> > directory containing Python's C library (e.g., <exec-prefix>/libs on
> > Windows)?

> Most probably from the registry somehow. In general, try & locate a
> python-executable, and make it execute

>   python -c "import sys; print sys.prefix"

> Capture that, and you're done. Depending on the OS, the libs then are
> placed in e.g. <prefix>/lib.

That doesn't solve anything, the hard part is figuring out the part
after <prefix> ..

Arve


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diez B. Roggisch  
View profile  
 More options Nov 15, 3:24 pm
Newsgroups: comp.lang.python
From: "Diez B. Roggisch" <de...@nospam.web.de>
Date: Sun, 15 Nov 2009 21:24:01 +0100
Local: Sun, Nov 15 2009 3:24 pm
Subject: Re: How to get directory of Python C library
arve.knud...@gmail.com schrieb:

AFAIK is that only varying based on the OS. Under unix, it's

  <prefix>/lib/python<version>/

You can get the platform via sys.platform.

Diez


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
arve.knudsen@gmail.com  
View profile  
 More options Nov 15, 4:08 pm
Newsgroups: comp.lang.python
From: "arve.knud...@gmail.com" <arve.knud...@gmail.com>
Date: Sun, 15 Nov 2009 13:08:22 -0800 (PST)
Local: Sun, Nov 15 2009 4:08 pm
Subject: Re: How to get directory of Python C library
On 15 Nov, 21:24, "Diez B. Roggisch" <de...@nospam.web.de> wrote:

Well, my point is that I should like a way to query for this
directory, just as I can query distutils.sysconfig for the include
directory and Python library (i.e., the standard Python library)
directory. It's not trivial to figure out Python's installation scheme
so long as it's not written in stone ..

Arve


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diez B. Roggisch  
View profile  
 More options Nov 15, 4:11 pm
Newsgroups: comp.lang.python
From: "Diez B. Roggisch" <de...@nospam.web.de>
Date: Sun, 15 Nov 2009 22:11:38 +0100
Local: Sun, Nov 15 2009 4:11 pm
Subject: Re: How to get directory of Python C library
arve.knud...@gmail.com schrieb:

Well, than how about you word your question like that? But there is no
simple function to call. So the answer to the question you asked is: no.

I showed you a way that works for current python, and consists of
stitching together a number of informations.

Diez


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
arve.knudsen@gmail.com  
View profile  
 More options Nov 15, 5:50 pm
Newsgroups: comp.lang.python
From: "arve.knud...@gmail.com" <arve.knud...@gmail.com>
Date: Sun, 15 Nov 2009 14:50:54 -0800 (PST)
Local: Sun, Nov 15 2009 5:50 pm
Subject: Re: How to get directory of Python C library
On 15 Nov, 22:11, "Diez B. Roggisch" <de...@nospam.web.de> wrote:

My original question was pretty clear I think. And I don't have the
required information to deduce what the library path may look like on
any given platform, there really should be a standard function for
this.

Arve


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Diez B. Roggisch  
View profile  
 More options Nov 15, 5:59 pm
Newsgroups: comp.lang.python
From: "Diez B. Roggisch" <de...@nospam.web.de>
Date: Sun, 15 Nov 2009 23:59:04 +0100
Local: Sun, Nov 15 2009 5:59 pm
Subject: Re: How to get directory of Python C library
arve.knud...@gmail.com schrieb:

I at least misunderstood it - which might be my fault. However, as there
is no such function. I suggest you discuss this on the devel-list -
however, anything before python2.7 is unlikely to grow such a function,
so you are stuck with the ways I described.

Diez


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
arve.knudsen@gmail.com  
View profile  
 More options Nov 15, 6:23 pm
Newsgroups: comp.lang.python
From: "arve.knud...@gmail.com" <arve.knud...@gmail.com>
Date: Sun, 15 Nov 2009 15:23:10 -0800 (PST)
Local: Sun, Nov 15 2009 6:23 pm
Subject: Re: How to get directory of Python C library
On 15 Nov, 23:59, "Diez B. Roggisch" <de...@nospam.web.de> wrote:

OK, thanks. Perhaps I'll try distutils-sig, given that it looks
natural to extend distutils.sysconfig.

Arve


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google