The directory structure
Conda packages are installed into environments, whose internal directory structure is something of a hybrid of Python virtual environment with the equivalent structures used by other packaging systems. These do not necessarily follow the same conventions as the underlying operating system, and they differ significantly between Unix and Windows installations.
The directory structure is currently governed by CEP 34.
This document describes the directories currently in use by a variety of conda-forge packages. It is not prescriptive. The use of some of the directories listed here is seen as controversial, and they may be explicitly discouraged in a future CFEP.
Unix directory structure
On Unix systems (Linux and macOS), conda-forge packages aim to follow a subset of the Filesystem Hierarchy Standard (FHS):
bin/: programs and scripts.- some packages also use
sbin/directory, though the distinction betweenbin/andsbin/is not meaningful for conda-forge.
- some packages also use
etc/: configuration files.include/: header files.lib/: dynamic and static libraries.- subdirectories of
lib/may also be used to host internal programs of packages, modules for Python and other programming languages, and general package-specific data. lib/cmakeandlib/pkgconfigare used to host respectively modules for software that is architecture-dependent.- conda-forge packages do not use multilib or multiarch suffixes (such as
lib64/).
- subdirectories of
share/: other data files.share/cmakeandshare/pkgconfigare used to host respectively modules for software that is architecture-independent.
Additionally, there may be directories named as target triplets that contain the relevant compiler executables and sysroots.
Package build systems largely follow these conventions upon detecting a Unix system. However, there
are many discrepancies, often resulting precisely from build system defaults. Some packages split
their executables over bin/ and sbin/, following the traditional Unix distinction. Others
install manpages or documentation into top-level man/ and doc/ directories rather than the
subdirectories of share/.
The same structure is also used by various scripting languages such as Python, permitting conda environments to act akin to Python virtual environments.
Windows directory structure
On Windows, the environment uses a hybrid layout that combines multiple layouts, namely:
Library/top-level directory is used by regular conda-forge packages. Its contents follow the Unix layout, with two differences:Library/bin/is used for programs (.exefiles) and dynamically-linked libraries (.dllfiles).Library/lib/is used for import libraries and static libraries (.libfiles).
Library/usr/tree is used by MSYS2 packages.- Python packages use layout similar to virtual environments:
DLLs/: core Python extensions (.pydfiles).include/: Python development headers.Lib/: core Python modules (.pyfiles).Lib/site-packages/: equivalent tolib/pythonX.Y/site-packages/on Unix, contains.pymodules and.pydextensions.
libs/: Python import libraries (.libfiles).Scripts/: Python entry points (.exetrampolines and the corresponding-script.pyfiles).Tools/: Miscellaneous Python tools.- The Python interpeter itself and its DLLs are installed in the top-level directory.
- Other programming languages also interpose their layouts:
- Node.js places its executables in the root level, and leaves everything else under
node_modules/. - R installs to
lib/R/using a Unix-style directory structure, but also places some executables inScripts/. - Ruby installs directly to the root level, using a Unix-style directory structure.
- Node.js places its executables in the root level, and leaves everything else under
Special conda files
In addition to the files normally installed by software, conda-forge packages install some files for the internal use of conda clients, namely:
conda-meta/: the metadata for installed packages, including the recipe used to build the package, and anything needed to run the test section for the package as defined in the recipe (which may include test-specific files that have been requested in the test section).etc/conda/: conda activation scripts and other files used by conda clients. The same path is also used on Windows (notLibrary/etc/).Menu/:*.jsonfiles (as defined by CEP 11), used to install menu items.
Additionally, packages may install pre/post-link/unlink scripts:
bin/.{package_name}-{action}.shon Unix.Scripts/.{package_name}-{action}.baton Windows.