In a previous episode we learned that Pixi can control conda
packages, but what is a conda package? Conda
packages (.conda files) are language agnostic file
archives that contain built code distributions. This is quite powerful,
as it allows for arbitrary code to be built for any target platform and
then packaged with its metadata. When a conda package is downloaded and
then unpacked with a conda package management tool (e.g. Pixi, conda,
mamba) the only thing that needs to be done to “install” that package is
just copy the package’s file directory tree to the base of the
environment’s directory tree. Package contents are also simple; they can
only contain files and symbolic links.
Exploring package structure
To better understand conda packages and the environment directory
tree structure they exist in, let’s make a new Pixi project and look at
the project environment directory tree structure.
✔ Created /home/<username>/pixi-lesson/dir-structure/pixi.toml
To help visualize this on the command line we’ll use the
tree program (Linux and macOS), which we’ll install as a
global utility from conda-forge using pixi global.
BASH
pixi global install tree
OUTPUT
└── tree: 2.2.1 (installed)
└─ exposes: tree
Windows PowerShell
already has a tree command, but is less powerful and
configurable than the Unix tree. It provides no way to
limit the tree depth, so we’ll use other commands instead like
Let’s now use tree to look at the directory structure of
the Pixi project starting at the same directory where the
pixi.toml manifest file is.
BASH
tree-L 3 .pixi/
OUTPUT
.pixi/
└── envs
└── default
├── bin
├── conda-meta
├── include
├── lib
├── man
├── share
├── ssl
├── x86_64-conda_cos6-linux-gnu
└── x86_64-conda-linux-gnu
11 directories, 0 files
POWERSHELL
ls-d 3.pixi\
OUTPUT
...
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 6/15/2025 7:34 AM conda-meta
d---- 6/15/2025 7:34 AM DLLs
d---- 6/15/2025 7:34 AM etc
d---- 6/15/2025 7:34 AM include
d---- 6/15/2025 7:34 AM Lib
d---- 6/15/2025 7:34 AM Library
d---- 6/15/2025 7:34 AM libs
d---- 6/15/2025 7:34 AM Scripts
d---- 6/15/2025 7:34 AM share
d---- 6/15/2025 7:34 AM Tools
...
We see that the default environment that Pixi created
has the standard directory tree layout for operating systems following
the Filesystem
Hierarchy Standard (FHS) (e.g. Unix machines)
bin: for binary executables
include: for include files (e.g. header files in
C/C++)
lib: for binary libraries
share: for files and data that other libraries or
applications might need from the installed programs
as well as some less common ones related to system administration
man: for manual pages
sbin: for system binaries
ssl: for SSL (Secure Sockets Layer) certificates to
provide secure encryption when connecting to websites
as well as other directories that are specific to conda packages
conda-meta: for metadata for all installed conda
packages
x86_64-conda_cos6-linux-gnu and
x86_64-conda-linux-gnu: for platform specific tools (like
linkers) — this will vary depending on your operating system
How did this directory tree get here? It is a result of all the files
that were in the conda packages we downloaded and installed as
dependencies of Python.
.conda is probably not a file extension that you’ve seen
before, but you are probably very familiar with the actual archive
compression format. .conda files are .zip
files that have been renamed, but we can use the same utilities to
interact with them as we would with .zip files.
We see that the .conda archive contained package format
metadata (metadata.json) as well as two other tar archives
compressed with the Zstandard compression algorithm
(.tar.zst). We can uncompress them manually with
tar
BASH
cd outputmkdir-p pkgtar--zstd-xvf pkg-python-*.tar.zst --directory pkg
and then look at the uncompressed directory tree with
tree
Hopefully this seems straightforward and unmagical — because it is!
Conda package structure is simple and easy to understand because it
builds off of basic file system structures and doesn’t try to invent new
systems. It is important to demystify what is happening with the
directory tree structure though so that we keep in our minds that our
tools are just manipulating files.
Exploring conda-forge
As of 2025 conda-forge has
over 28,500 packages on it. Go to the conda-forge package list website
(https://conda-forge.org/packages/) and try to find three
packages that you use in your research, and three packages from your
scientific field that are more niche.