I've been seeing the error No module named 'ruamel' when running a python script (with python3), even after running the command pip3 install ruamel.yaml
1 Answer
The issue was that the versions of pip and python were mismatched, so pip was installing the ruamel module onto python 3.8, but running python3 was using python 3.9
To diagnose the issue:
- Check the python version being used with
python3 --version - Check the pip version being used with
pip3 --version
If the versions are different, you can call pip with the exact version number. For example, pip3.9 install ruamel.yaml to ensure that the module is installed onto the correct python version.