

The layout is irrelevant, it’s just a directory of importable code. In the first case, I’d say you want your link to the system Python to include a PYTHONPATH setting to an arbitrary directory that you control where you put your packages. Does this mean that if I have a Spack environment (in its “unique installation prefix”) and add Python to it, it may just link in my system install? If I then add a package written in Python, do I have to launch Python through the Spack environment in order to access that package? Or can I launch the system install directly to get it? Spack supports reusing system installations of Python (built with apt, yum, conda, etc.).

Note: I originally opened this question on the setuptools GitHub but it seems like this question is better asked to the broader community. Is this how these installation methods make the decision? How do these installation methods decide whether to use purelib or platlib? So far the most reliable method I’ve found is to query _python_lib(.) (deprecated) or sysconfig.get_path(.). installer: python -c 'import installer installer.install(.)'.setuptools: legacy python setup.py install (deprecated).distutils: legacy python setup.py install (deprecated).My question is, when installing a Python library, how does the site-packages directory get decided? Does it depend on the installation method? For example, do all of the following make the same decisions: We would like to know this directory ahead of time so that we can set PYTHONPATH appropriately. lib/python/site-packages on macOS with framework Python.

