Uncategorized

linux – Unable to import tkinter for Python file in VSCodium for Pop!_OS


I was trying to install tkinter for my Python file so that I would be able to display a window with GUI. However I am encountering this error: File "/home/zhenf/VSCodium_Workspace/pyfilereader/fileReader.py", line 4, in <module> import tkinter as tk ModuleNotFoundError: No module named 'tkinter' when I try to run my python file in VSCodium.

I downloaded python with the command sudo apt install python3 for my Home folder, parent folder where my project folder is located, and my project folder where my python file is stored. I have tkinter installed in my Home folder and my project folder. tkinter works fine when I run the python shell on my Pop!_OS terminal but does not work when I try to run my python file with VSCodium.

How may I be able to resolve this issue?

enter image description here



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *