ImportError: No module named 'yaml'

后端 未结 6 941
既然无缘
既然无缘 2020-12-30 22:11

I have one script in which I am trying to execute

python3 env/common_config/add_imagepullsecret.py

But, I am getting the following error:<

6条回答
  •  感情败类
    2020-12-30 23:07

    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 :)

提交回复
热议问题