Skip to content

Article PYTHON AND DATA

Reading time
5 min
Published

Python training on a ready-made environment

The difference between an exercise that works and one that does not often lies in the interpreter version, a system library or a data file. Ready-made workstations let you test all the material before the class and give the group the same starting point.

A Python environment starts with the full interpreter version

The difference between Python 3.10 and 3.12 can affect syntax, module availability and dependency compatibility. The major version number is not enough. The training configuration should record the full interpreter version, how it is installed and the system architecture. If the material uses a version management tool, that tool should have a pinned version too.

Every project should run in an isolated package environment. This might be venv, Poetry, uv or another tool that fits the material. What matters is repeatability: installing from a lock file or a set of pinned versions should produce the same dependency graph on every workstation.

Python packages can depend on the system

Libraries for data analysis, images, cryptography or databases often use native code. Installing them may require a compiler, headers and system libraries. A package that works on the instructor's computer thanks to a prebuilt wheel may attempt to compile on a different architecture or system version.

Before the training, run the installation on a clean image and from a participant's account. If the class takes place without internet access, the required packages and artefacts must be placed in a local cache or repository. Otherwise the start of the workshop will depend on the availability of an external index and on bandwidth.

Jupyter and an IDE lead to different ways of working

A notebook is convenient for data analysis and for explaining code step by step, but its state does not always follow from the order of the visible cells. Exercises should work after restarting the kernel and running the cells from the top. It is also worth showing where the data files are and how to identify the active environment.

An IDE suits package structure, tests and refactoring better. The configuration should cover the chosen interpreter, running tests and linting. There is no need to install several editors just in case. One proven way of working is clearer for the group, and people who prefer the terminal can still run the same commands.

Input data must be available and documented

A CSV file sitting in the instructor's directory is not part of the participant's environment. Data should be in the repository, in a shared read-only directory, or be downloaded by a versioned script. The material must state the encoding, the separator, the expected schema and how to verify the integrity of larger files.

For company exercises it is better to prepare synthetic data than to copy real records. If a realistic distribution is needed, a generator can preserve proportions and relationships without reproducing anyone's identity. Participants should know which files are starter material and which are their own results.

The material must be run from a clean state

The instructor's test should cover installation, importing every module, running the notebooks or scripts, running the tests and saving the results. Pay particular attention to hidden dependencies: environment variables, files in the home directory, model caches and credentials for services.

The best test is a new VM created from the image intended for the group. If the material needs a manual fix before the start, the fix should go into the base configuration rather than being repeated on every workstation. Once the test passes, the image can be cloned for the participants.

Code errors should be visible, and environment errors recognisable

Participants must be able to tell a SyntaxError from a missing package, a path error or a refusal to access a file. The instructions can include a short list of diagnostic commands: the Python version, the interpreter path, the list of packages and the current directory. That is enough to solve most problems without interrupting the class for the whole group.

The instructor should have the same context and the ability to inspect a chosen workstation. Shared versions mean that an error message means the same thing for everyone. Differences between solutions then come from the code and the way people think, not from an accidental laptop configuration.

After the training, keep the code and a record of the environment

The outcome of the class is code, a notebook, a report or a model, not the whole machine. Participants should know where to export their files before access expires. Together with the result, it is worth keeping the dependency file, the Python version and a short command for running it.

Ready-made VMs for a training group can include the interpreter, libraries, an IDE, data and a shared directory of materials. A configuration like this gives the instructor a controlled starting point, and participants the chance to work without touching their local system.