This error:
TclError: no display name and no $DISPLAY environment variable
arose when I tried to run a Python 3.6 program inside google\'s
The problem is the tkinter
that you are trying to use.
Tk will normally create GUI (like a new window) for your interface. But Colab is run on the web server in the cloud. It can't open a window on your machine. You can only interact with it through notebook interface.
You need to limit the interaction not to use GUI. Or change them to web-based through notebook. What kind of program are you trying to run?