ImportError: No module named 'yaml' ImportError: No module named 'yaml' python python

ImportError: No module named 'yaml'


pip install pyyaml

This should serve the purpose


Solution 1: install python 3.6(or use pyenv to manage py version) and ln python3 to it

export $PYPATH=`which python3`wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xztar -Jxf Python-3.6.5.tar.xzcd Python-3.6.5/./configure && make && make altinstallrm $PYPATHln -s `which python3.6` $PYPATHpython3 -m pip install pyyamlpython3 env/common_config/add_imagepullsecret.py

Solution 2: use virtualenv (or python -m venv)

pip3 install virtualenvvirtualenv --python=python3 venvsource venv/bin/activatepip install pyyamlpython env/common_config/add_imagepullsecret.py

Solution 3: use python-poetry or pipenv

https://github.com/python-poetry/poetry

https://github.com/pypa/pipenv


Try the follwoing:
1. uninstall python-yaml and its dependencies.

$ sudo apt-get remove python3-yaml$ sudo apt-get remove --auto-remove python3-yaml

Purging your config/data too.

$ sudo apt-get purge python3-yaml$ sudo apt-get purge --auto-remove python3-yaml
  1. Install pyyaml

    $ sudo pip3 install pyyaml

this worked for me.