Search code examples
pythonimportmodulepyyaml

cannot import yaml on mac


The software I have requires yaml, based on the import yaml at the top. I installed pyyaml on the mac I am using and it still threw the import error. I tried to change the code in the program to import pyyaml but that still didn't help. Any idea what the module is called to import it? If you need more information just ask.


Solution

  • For python2: sudo yum install python-yaml

    For python3: sudo yum install python3-yaml