Differences between Framework and non-Framework builds of Python on Mac OS X

前端 未结 5 464
北恋
北恋 2020-11-30 21:56

Question

What are the differences between a Framework build and a non-Framework build (i.e., standard UNIX build) of Python on Mac OS X? Also, what are the advanta

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-30 22:30

    There is another difference: typically the Framework installation provided by the installer from python.org has several architectures.

    $ file libpython2.7.dylib

    libpython2.7.dylib: Mach-O universal binary with 2 architectures libpython2.7.dylib (for architecture i386): Mach-O dynamically linked shared library i386 libpython2.7.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64

    If you install from source and you do not deliberately change this, your libpython has only one architecture. I have had cases where the two architectures actually resulted in problems (at least I believe that this was the reason), namely when installing the HDF5 python bindings (h5py).

    And there is yet another difference: some tools require the framework installation. For instance PyQt, and in particular sip. While it is possible to install sip and PyQt even for the non-framework version of python, it is much more complicated.

    As for the decision what to prefer, I still do not know. At the moment, I went for the non-framework option, but I must say, that it also caused me some headache.

提交回复
热议问题