[Pythonmac-SIG] Link against Python Framework
Hi, In my Cocoa app, I link agains the Python framework to be able to call "PyRun_SimpleString" and load bundles based on python. If I set the Base SDK to 10.5, it runs on 10.5 and 10.6. But if I set it to 10.6 and MACOSX_DEPLOYMENT_TARGET = 10.5 it complains in Leopard that it can’t find python 2.6. Is there a my to always use the current python version (2.5 on Leopard and 2.6 on Snow Leopard) I link against the "/System/Library/Frameworks/Python.framework" Regards Georg ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Link against Python Framework
On Wednesday, 09 September, 2009, at 02:10PM, "Georg Seifert" wrote: >Hi, > >In my Cocoa app, I link agains the Python framework to be able to call >"PyRun_SimpleString" and load bundles based on python. > >If I set the Base SDK to 10.5, it runs on 10.5 and 10.6. But if I set >it to 10.6 and MACOSX_DEPLOYMENT_TARGET = 10.5 it complains in Leopard >that it can’t find python 2.6. > >Is there a my to always use the current python version (2.5 on Leopard >and 2.6 on Snow Leopard) > >I link against the "/System/Library/Frameworks/Python.framework" In short: no, that is not possible. Major Python releases (such as 2.5 and 2.6) are not necessarily binary compatibel. If you are careful you can get a single binary that works with 2.5 and 2.6, but you then have to load the framework manually and also manually resolve any python API functions you are using. The easiest way to do that is using the CFBundle APIs in CoreFoundation. It might be easier to create two plugin bundles for your application: one that links against 2.6 and one that links against 2.5. You can then load the plugin that is most appropriate for the currently running OS version. Ronald > >Regards >Georg > >___ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] Compiling libhid with python support : configure can't link to test program
Hello everyone, I would like to compile libhid (because I couldn't find it already compiled) on mac os x 10.5.x. When I run configure it dies saying it can't link against my python lib and that it may be installed in an alternative location or that I need to install a dev version of python. I'm using the version shipped with 10.5, does anyone know how to fix this? Thank you, Gabriel ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Link against Python Framework
Major Python releases (such as 2.5 and 2.6) are not necessarily binary compatibel. If you are careful you can get a single binary that works with 2.5 and 2.6, but you then have to load the framework manually and also manually resolve any python API functions you are using. The easiest way to do that is using the CFBundle APIs in CoreFoundation. Does this mean that if one builds a PyObjC application using Apple's tools--Xcode, linking against the system Python and PyObjC frameworks--then it may break in an OS upgrade if Apple has upgraded the system Python installation? I've always wondered about this. -- Kevin Walzer Code by Kevin http://www.codebykevin.com ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Compiling libhid with python support : configure can't link to test program
Gabriel Rossetti wrote: Hello everyone, I would like to compile libhid (because I couldn't find it already compiled) on mac os x 10.5.x. When I run configure it dies saying it can't link against my python lib and that it may be installed in an alternative location or that I need to install a dev version of python. I'm using the version shipped with 10.5, does anyone know how to fix this? Thank you, Gabriel Here's some more info, it does this : Compiled with g++ [i686-apple-darwin9.0] Please see http://www.swig.org for reporting bugs and further information checking for python... /usr/bin/python checking for python version... 2.5 checking for python platform... darwin checking for python script directory... /Library/Python/2.5/site-packages checking for python extension module directory... /Library/Python/2.5/site-packages checking for python2.5... (cached) /usr/bin/python checking for a version of Python >= '2.1.0'... yes checking for the distutils Python package... yes checking for Python include path... -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 checking for Python library path... /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/Python.framework/Versions/2.5/Python checking for Python site-packages path... /Library/Python/2.5/site-packages checking python extra libraries... -ldl checking python extra linking flags... -u _PyMac_Error -framework Python checking consistency of all components of python development environment... no configure: error: Could not link test program to Python. Maybe the main Python library has been installed in some non-standard library path. If so, pass it to configure, via the LDFLAGS environment variable. Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" ERROR! You probably have to install the development version of the Python package for your distribution. The exact name of this package varies among them. I looked at this line : checking for Python library path... /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/Python.framework/Versions/2.5/Python and that path doesn't exist, this one does though : /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/ and inside there is libpython2.5.a which is the static python lib, I tried doing as it said : ./configure LDFLAGS="-L/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/" with no luck though. Thank you, Gabriel ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Link against Python Framework
On Wednesday, 09 September, 2009, at 04:07PM, "Kevin Walzer" wrote: >> >> Major Python releases (such as 2.5 and 2.6) are not necessarily binary >> compatibel. If you are careful you can get a single binary that works with >> 2.5 and 2.6, but you then have to load the framework manually and also >> manually resolve any python API functions you are using. The easiest way to >> do that is using the CFBundle APIs in CoreFoundation. >> > >Does this mean that if one builds a PyObjC application using Apple's >tools--Xcode, linking against the system Python and PyObjC >frameworks--then it may break in an OS upgrade if Apple has upgraded the >system Python installation? I've always wondered about this. That could in theory break applications. Luckily Apple is very reluctant about breaking applications and hence ships multiple versions of Python (/System/Library/Frameworks/Python.framework on 3 versions of python: 2.3, 2.5 and 2.6). This means that you can safely link to the system Python on a 10.5 system (or even a 10.3.9 system) and run your application on a 10.6 system. Ronald ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] macholib unknown load command: 2147483682
On 9 Sep, 2009, at 6:29, Emanuele Santos wrote: I am already using the latest versions of both macholib and py2app. Could you try again? I've just checked in a patch for macholib that adds minimal support for some new loader commands (r28 in the macholib repository) Ronald Thanks, -- Emanuele. On Sep 8, 2009, at 5:36 PM, Christopher Barker wrote: Emanuele Santos wrote: I am trying to create a bundle using py2app dev on snow leopard and python 2.6 and I am getting the following error with macholib: ValueError: Unknown load command: 2147483682 Is there anything I can do to fix it? Make sure you have the latest macholib. You may want install the latest dev version: easy_install macholib==dev If that doesn't fix it, it may be that snow leopard has added a new load command that macholib doesn't know what to do with. I think this may require a patch to macholib, but I'm not an expert -- Ronald? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig smime.p7s Description: S/MIME cryptographic signature ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Link against Python Framework
On Sep 9, 2009, at 9:07 AM, Kevin Walzer wrote: Major Python releases (such as 2.5 and 2.6) are not necessarily binary compatibel. If you are careful you can get a single binary that works with 2.5 and 2.6, but you then have to load the framework manually and also manually resolve any python API functions you are using. The easiest way to do that is using the CFBundle APIs in CoreFoundation. Does this mean that if one builds a PyObjC application using Apple's tools--Xcode, linking against the system Python and PyObjC frameworks--then it may break in an OS upgrade if Apple has upgraded the system Python installation? I've always wondered about this. In theory, it is possible. But Apple takes care to maintain backwards compatibility. If you poke around in /System/Library/Frameworks/ Python.framework/Versions, you'll see that (on Snow Leopard) they ship 2.6, 2.5, *and* 2.3 (2.3 shipped with Tiger). So the version of Python to which your app links should be available going forward. If you want to make absolutely sure that Apple can't break you, you could bundle the version of Python.framework upon which you depend into your app. However, that's probably not necessary unless you want to use a newer version of Python than the system has (say, 3.0+, or 2.6 on Leopard). Jason smime.p7s Description: S/MIME cryptographic signature ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] macholib unknown load command: 2147483682
Thanks, Ronald! It is working now. -- Emanuele. On Sep 9, 2009, at 12:22 PM, Ronald Oussoren wrote: On 9 Sep, 2009, at 6:29, Emanuele Santos wrote: I am already using the latest versions of both macholib and py2app. Could you try again? I've just checked in a patch for macholib that adds minimal support for some new loader commands (r28 in the macholib repository) Ronald Thanks, -- Emanuele. On Sep 8, 2009, at 5:36 PM, Christopher Barker wrote: Emanuele Santos wrote: I am trying to create a bundle using py2app dev on snow leopard and python 2.6 and I am getting the following error with macholib: ValueError: Unknown load command: 2147483682 Is there anything I can do to fix it? Make sure you have the latest macholib. You may want install the latest dev version: easy_install macholib==dev If that doesn't fix it, it may be that snow leopard has added a new load command that macholib doesn't know what to do with. I think this may require a patch to macholib, but I'm not an expert -- Ronald? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] python-sap webservices
Hi, This is sudhakar, i am using python frame work and now concentrating on working on web services in python. I installed SOAPpy-0.12.0 on mac but getting errors as below: venj:SOAPpy-0.12.0 venkata$ python setup.py build Traceback (most recent call last): File "setup.py", line 8, in from SOAPpy.version import __version__ File "/Applications/SOAPpy-0.12.0/SOAPpy/__init__.py", line 5, in from Client import * File "/Applications/SOAPpy-0.12.0/SOAPpy/Client.py", line 46 from __future__ import nested_scopes SyntaxError: from __future__ imports must occur at the beginning of the file venj:SOAPpy-0.12.0 venkata$ python setup.py install Traceback (most recent call last): File "setup.py", line 8, in from SOAPpy.version import __version__ File "/Applications/SOAPpy-0.12.0/SOAPpy/__init__.py", line 5, in from Client import * File "/Applications/SOAPpy-0.12.0/SOAPpy/Client.py", line 46 from __future__ import nested_scopes SyntaxError: from __future__ imports must occur at the beginning of the file Hey please suggest me how to solve this error. Hey actually whats my requirement is i need to gather information from SAP system and Store it in Python appliction server. For this i am thinking to construct a web service on python in order to get the data from SAP system. Is this the correct way or is there any other possibility get in formation and store it in python application and i use mysql database for python. Please give your valuable suggestion. Waiting for early reply. with regards S Sudhakar. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig