[New-bugs-announce] [issue45998] Document best practice for including and linking python framework

Ronald Oussoren report at bugs.python.org
Mon Dec 6 10:00:33 EST 2021


New submission from Ronald Oussoren <ronaldoussoren at mac.com>:

There are two ways to develop against a Python.framework on MacOS:

1. Use the regular Unix pattern with "#include "Python.h", using compiler flags to select the right headers and libraries.

2. Using the native framework pattern with "#import <Python/Python.h>" and "-framework Python"

Both works, but the latter has the disadvantage of loosing control over which version of Python is used when multiple versions are installed.  The version is selected by the "Current" link in the framework, which is overwritten to point to whatever version was last installed or updated.

IMHO we should document this pitfall in the C API documentation.

----------
assignee: docs at python
components: Documentation, macOS
messages: 407821
nosy: docs at python, ned.deily, ronaldoussoren
priority: normal
severity: normal
stage: needs patch
status: open
title: Document best practice for including and linking python framework
type: enhancement
versions: Python 3.10, Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45998>
_______________________________________


More information about the New-bugs-announce mailing list