• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Locating Frameworks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Locating Frameworks


  • Subject: Re: Locating Frameworks
  • From: "email@hidden" <email@hidden>
  • Date: Tue, 15 Jun 2010 17:06:56 +0100


On 15 Jun 2010, at 14:58, F van der Meeren wrote:

> Hi,
>
> I am trying to link to the Python.framework.
> According to the manpages the framework directories are searched in the following order:
> "The default framework search path is /Library/Frameworks then /System/Library/Frameworks."
>
> Running my code:
>
> Py_Initialize();
> PyRun_SimpleString("import sys\n"
>            "print('Version: ', sys.version)\n");
> Py_Finalize();
>
> Shows the following:
> ('Version: ', '2.6.1 (r261:67515, Feb 11 2010, 00:51:29) \n[GCC 4.2.1 (Apple Inc. build 5646)]')
>
> But I have Python 3.1.2 installed in the /Library/Frameworks path, shouldn't this library be used and result in the following version info ?
> '3.1.2 (r312:79360M, Mar 24 2010, 01:33:18) \n[GCC 4.0.1 (Apple Inc. build 5493)]'
>
> So my question is the following: How do I force the linking with the Python 3.1.2 version (or highest version installed)?
>
Try calling Py_SetProgramName() before Py_Initialize()

NSString *launchPath =  @"/Library/Frameworks/Python.framework/versions/current/bin/python";
Py_SetProgramName((char *)[launchPath UTF8String]);

Regards

Jonathan Mitchell

Developer
Mugginsoft LLP
http://www.mugginsoft.com

> Thanks,
>
> Filip
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Locating Frameworks
      • From: F van der Meeren <email@hidden>
References: 
 >Locating Frameworks (From: F van der Meeren <email@hidden>)

  • Prev by Date: Re: Question about fading a UISlider
  • Next by Date: Re: Locating Frameworks
  • Previous by thread: Locating Frameworks
  • Next by thread: Re: Locating Frameworks
  • Index(es):
    • Date
    • Thread