This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Doc sys.prefix lib & include directories on Windows and Mac
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: CatherineH, docs@python, miss-islington, ned.deily, steve.dower, terry.reedy, vstinner
Priority: normal Keywords: patch

Created on 2021-11-11 18:16 by CatherineH, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29606 merged terry.reedy, 2021-11-18 05:15
PR 29631 merged miss-islington, 2021-11-18 20:08
PR 29632 merged miss-islington, 2021-11-18 20:08
Messages (10)
msg406168 - (view) Author: Catherine Holloway (CatherineH) Date: 2021-11-11 18:16
On the page:

https://docs.python.org/3.10/library/sys.html#sys.prefix

the text says

The main collection of Python library modules is installed in the directory prefix/lib/pythonX.Y while the platform independent header files (all except pyconfig.h) are stored in prefix/include/pythonX.Y, where X.Y is the version number of Python, for example 3.2.

However, this seems to only be true on *nix systems. On Windows, the lib and header files are just in prefix/lib and prefix/include. Maybe the text should be changed to say:

On linux, the main collection of Python library modules is installed in the directory prefix/lib/pythonX.Y while the platform independent header files (all except pyconfig.h) are stored in prefix/include/pythonX.Y, where X.Y is the version number of Python, for example 3.2. On Winodws, there are in prefix/lib and prefix/includes.
msg406249 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-11-12 22:53
On Windows, I believe the correct sentence would be "On Windows, they are in prefix/Lib and prefix/include".  Ned, how to complete "On macOS, they are in ?."

Victor, with recent file movement, is "while the platform independent header files (all except pyconfig.h) are stored in prefix/include" still true?  In what way is pyconfig.h exceptional?  Should 'include' be augmented with 'or its subdirectories'?
msg406253 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2021-11-12 23:09
Which installations paths are used varies on other factors besides platform. Rather than duplicate information here, I suggest simplifying the sys.prefix doc here by removing the details about installation paths and instead refer to the Installation Paths section of the sysconfig module documentation, which should be the primary reference for this info:

https://docs.python.org/3/library/sysconfig.html#installation-paths
msg406255 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2021-11-12 23:18
> Victor, with recent file movement, is "while the platform independent header files (all except pyconfig.h) are stored in prefix/include" still true?

Are you talking about Include/cpython/ and Include/internal/ subdirectories?

> Should 'include' be augmented with 'or its subdirectories'?

You can add it if you want.
msg406261 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-11-13 00:44
Ned, I like your idea.  In particular, link to sysconfig.get_paths for how prefix is used on a particular machine to define installation paths.

Sidenote:
https://docs.python.org/3/library/sysconfig.html#installation-paths
says "Python currently supports seven schemes:" and lists 5  get_scheme_names list 6, with the extra one being
'osx_framework_user'.  Would
  osx_framework_user: scheme for macOS
be a satisfactory entry?
msg406264 - (view) Author: Catherine Holloway (CatherineH) Date: 2021-11-13 01:09
Hey thanks Ned, sysconfig was exactly what I was looking for when I was reading the sys documentation.
msg406265 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2021-11-13 03:55
> Would osx_framework_user scheme for macOS be a satisfactory entry?

Yes, it should be there.
msg406562 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-11-18 20:08
New changeset 4575c01b750cd26377e803247c38d65dad15e26a by Terry Jan Reedy in branch 'main':
bpo-45788: Link sys.prefix doc to 'Installation paths' (#29606)
https://github.com/python/cpython/commit/4575c01b750cd26377e803247c38d65dad15e26a
msg406564 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-11-18 21:45
New changeset c06c7c489a82b2db023bb947f0c4d21ad93b8308 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-45788: Link sys.prefix doc to 'Installation paths' (GH-29606) (GH-29632)
https://github.com/python/cpython/commit/c06c7c489a82b2db023bb947f0c4d21ad93b8308
msg406565 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-11-18 21:46
New changeset 2a630e716e488ac420d308736568829f76e388a3 by Miss Islington (bot) in branch '3.10':
[3.10] bpo-45788: Link sys.prefix doc to 'Installation paths' (GH-29606)
https://github.com/python/cpython/commit/2a630e716e488ac420d308736568829f76e388a3
History
Date User Action Args
2022-04-11 14:59:52adminsetgithub: 89946
2021-11-18 21:46:42terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-11-18 21:46:15terry.reedysetmessages: + msg406565
2021-11-18 21:45:24terry.reedysetmessages: + msg406564
2021-11-18 20:08:41terry.reedysetmessages: + msg406562
2021-11-18 20:08:41miss-islingtonsetpull_requests: + pull_request27864
2021-11-18 20:08:36miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request27863
2021-11-18 05:15:47terry.reedysetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request27847
2021-11-13 03:55:44ned.deilysetmessages: + msg406265
2021-11-13 01:09:46CatherineHsetmessages: + msg406264
2021-11-13 00:44:53terry.reedysetmessages: + msg406261
2021-11-12 23:18:58vstinnersetmessages: + msg406255
2021-11-12 23:09:30ned.deilysetmessages: + msg406253
2021-11-12 22:53:05terry.reedysetversions: + Python 3.11, - Python 3.6, Python 3.7, Python 3.8
type: enhancement -> behavior

nosy: + terry.reedy, ned.deily, vstinner, steve.dower
title: sys.prefix include directory on Windows -> Doc sys.prefix lib & include directories on Windows and Mac
messages: + msg406249
stage: needs patch
2021-11-11 18:16:42CatherineHcreate