How can I switch the python version from 3.6.7 to 2.7.13?

Recent preview versions of Slicer switched to Python3 and we will not ever go back to Python2. You need to make minor changes to your Python2 modules to make them compatible with Python3 as described in this topic: