Record the software versions a result depends on¶
Draft: not yet validated
The commands on this page were run in MESA JupyterLab on 2026-11-13, by the AI assistant that drafted it, and produced the output shown. No person has yet followed the steps. Tell us what you find.
The software in a MESA app changes when the app is rebuilt. A number you computed today may not come out the same next year, and without a record you cannot tell whether the data or the software changed.
You will: have two small files beside your work that say which Python and which package versions it ran on.
Time: 5 minutes. You need: MESA JupyterLab running, and
a folder that holds your work, such as mesa-practice from the
practice data.
Steps¶
-
In JupyterLab's file browser, open the folder that holds your work. In the Launcher, click Terminal.
You should see: a terminal whose prompt ends with the name of your folder. A terminal opened from the Launcher starts in the folder the file browser is showing.
-
Check the Python version:
python --versionYou should see: one line, such as
Python 3.13.18. -
Write every installed package and its version to a file:
pip list --format=freeze > requirements.txtYou should see: no output, and
requirements.txtin the file browser. -
Count what was recorded:
wc -l requirements.txtYou should see: a few hundred lines, one for each package. In our test:
244 requirements.txt -
Look up the packages your work imports:
grep -E '^(pandas|duckdb|numpy)==' requirements.txtYou should see: one line for each, with its version. In our test:
duckdb==2.0.0 numpy==2.5.4 pandas==3.1.1 -
Write a one-line note that ties the two together and dates them:
echo "Python $(python --version | cut -d' ' -f2), packages in requirements.txt, recorded $(date +%F)" > environment.txt cat environment.txtYou should see: the note. In our test:
Python 3.13.18, packages in requirements.txt, recorded 2026-11-13
Check it worked¶
The folder holds requirements.txt and environment.txt, and step 5 shows a version
for each package your work imports.
If it didn't¶
Step 5 prints nothing. The package names in the pattern do not match what is
installed. Search for one name without the ==, for example
grep -i pandas requirements.txt, and use the spelling it shows.
Next¶
- These files record the software; they do not rebuild it. To run old work again you need an app with the same versions, or to install them yourself.
- Record again whenever a result goes into a report: the date in
environment.txtsays which run the record belongs to. - Leave a notebook someone else can rerun
- Write a README for a data folder, and mention these two files in it.
Not yet validated by a person. Drafted with AI assistance on 2026-11-13 and followed in MESA JupyterLab that day.
Machine-readable versions of this page: Markdown twin · raw source on GitHub · llms.txt · llms-full.txt (whole site). See For AI agents.