Solution 1: install python 3.6 and ln python3 to it
export $PYPATH=`which python3`
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
tar -Jxf Python-3.6.5.tar.xz
cd Python-3.6.5/
./configure && make && make altinstall
rm $PYPATH
ln -s `which python3.6` $PYPATH
python3 -m pip install pyyaml
python3 env/common_config/add_imagepullsecret.py
Solution 2: use virtualenv
pip3 install virtualenv
virtualenv --python=python3 venv
source venv/bin/activate
pip install pyyaml
python env/common_config/add_imagepullsecret.py
Solution 3: use pipenv

It is best practice of a developer to create a virtualenv for every project he creates.This helps you to maintain the dependencies isolated from the root config of the system
Installing virtualenv
cd /*desired*/
mkdir myProject
pip install virtualenv -p python3 . #For python 3
pip install virtualenv -p python2 . #For python 2
pip install pyyaml

pip freeze > requirements.txt
After this you will be able to see a text doc containing all the dependencies you have installed in the virtualenv.
Cheers :)

Comments