Fix ModuleNotFoundError: No module named ‘yaml’ Error – PyTorch Tutorial

By | June 6, 2022

When we are running pytorch scripts, we may get this error: ModuleNotFoundError: No module named ‘yaml’. In this tutorial, we will introduce you how to fix it.

Install yaml model

We can use pip to install this model, for example:

pip install -i https://mirrors.aliyun.com/pypi/simple/ pyyaml --trusted-host mirrors.aliyun.com

We should notice: we should install pyyaml, not yaml. Otherwise, you will get an error.

Run this command, we will find this error is fixed.

Fix ModuleNotFoundError No module named 'yaml' Error - PyTorch Tutorial

Leave a Reply