Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Installation

pyTEMlib


OpenInColab

pyTEMlib , a pycroscopy library

Installation

pyTEMlib

a pycroscopy ecosystem package

Notebook by Gerd Duscher, 2025

Microscopy Facilities
Institute of Advanced Materials & Manufacturing
The University of Tennessee, Knoxville

Model based analysis and quantification of data acquired with transmission electron microscopes

Prerequesites

A usual installation of python or python envirnment (like anaconda - recomended) is sufficient.

Installation

The installation of pyTEMlib with all its dependencies can be done with the code cell below, right here in this jupyter notebook

In google colab, with always a clean, new python installation, you will have to run this every (run)time.

So this code cell is added to every notebook.

At your own installation, you need to run this codecell only once.

Note:

To update pyTEMLib you need to run this code cell first

Otherwise pyTEMlib is already loaded and you need to restaart the notebook for the new version to take effect

import sys
import importlib.metadata
def test_package(package_name):
    """Test if package exists and returns version or -1"""
    try:
        version = importlib.metadata.version(package_name)
    except importlib.metadata.PackageNotFoundError:
        version = '-1'
    return version

if test_package('pyTEMlib') < '0.2025.12.1':
    print('installing pyTEMlib')
    !{sys.executable} -m pip install  --upgrade pyTEMlib -q

print('done')

Testing Installation

Once you have installed pyTEMlib, you will need to import it in every notebook or python instance.

To check installation and version, use the minimal comands below.

import pyTEMlib
print('pyTEMlib version', pyTEMlib.__version__)
pyTEMlib version 0.2025.12.0

Summary

You will find the code above in each of the notebooks of this documentation of pyTEMlib to run at google colab.

These code cells are the minimal requirements for the installation.