Lab 3 environment issue - ModuleNotFoundError: No module named 'psutil' in Glue kernel

Week #: 3

Link: Week 3 Lab - Lab_3_fine_tune_model_to_detoxify_summaries.ipynb in SageMaker Studio

Description: I’m encountering environment issues when trying to run Lab 3. When executing the verification function at the beginning of the lab, I receive a “ModuleNotFoundError: No module named ‘psutil’” error. The problem appears to be that I’m in an AWS Glue Interactive Sessions environment (4 vCPUs, 15.3 GiB) instead of the required SageMaker ml.m5.2xlarge (8 vCPUs, 32 GiB) instance.

Even after running %pip install psutil, which shows the package is already installed, the error persists. I also encountered dependency conflicts when installing required packages like torch, torchdata, and other libraries. Since lab resources are time-constrained (2 hours), I’m concerned I won’t be able to complete the lab due to these technical issues.

Could someone please help with:

  1. How to access the proper SageMaker environment with ml.m5.2xlarge
  2. How to fix the module error or work around it
  3. Possibly extending lab time for a proper second attempt
1 Like

Hi Rodger, and welcome to the Forum! Please pick the Python 3 kernel as mentioned in the lab instructions on Vocareum. You can retake the lab but it might take a while to start. The dependency conflicts should be safe to ignore as mentioned in the markdown. You might also find this FAQ useful as you take the labs in this course. Hope this helps!

2 Likes