R
RunPod2mo ago
TVC

While runnning a python file in my pod, I encounter a ModuleNotFound Error for tkinter

I have installed tkinter using pip and through apt-get install python3-tk . Still getting the error. I don't care about the gui as much as I care that my application completes (the application results are independent of gui tools). What can I do?
24 Replies
Madiator2011
Madiator20112mo ago
Would need to know more details
nerdylive
nerdylive2mo ago
maybe its using venv, and yes give more details on your problem like logs on the error and explain more
TVC
TVC2mo ago
Thanks for the reply folks, I cant find gpus for my pod yet, let me create the issue and send the exact error logs and the steps I followed to run it. In the meantime, what details should I include? I am planning show the list of packages I installed, the order of installation, and the name of my pod's template. Also the error log, obviously. Anything else which would help you?
nerdylive
nerdylive2mo ago
What's the error What command did you run Lastly what do you expect
TVC
TVC2mo ago
Error message -
TVC
TVC2mo ago
No description
TVC
TVC2mo ago
dependencies installed (through pip)- name: MonoGS channels: - pytorch - conda-forge - defaults dependencies: # - cudatoolkit=11.6 - plyfile==0.8.1 - python==3.7.13 - pip==22.3.1 # - pytorch=1.12.1 # - torchaudio=0.12.1 # - torchvision=0.13.1 - tqdm - pyyaml - pip: - submodules/simple-knn/ - submodules/diff-gaussian-rasterization/ - opencv-python==4.8.1.78 - munch - trimesh - evo==1.11.0 - open3d==0.17.0 - torchmetrics - imgviz - PyOpenGL==3.1.1a1 - glfw - PyGLM - wandb - lpips - rich - ruff I also installed tkinter explicitly apt-get install python-tk pip install tk Template used - RunPod Pytorch 1.13.1 runpod/pytorch:1.13.0-py3.10-cuda11.7.1-devel-ubuntu22.04 RTX A4500 Should I comment out the plt.figure() line?
nerdylive
nerdylive2mo ago
Maybe you're using venv, and forgot to activate it before installing pip package sure if thats okay nvm
TVC
TVC2mo ago
Hi, no I wrote a script to pip install all the dependencies, instead of installing them through a venv (the file is built for anaconda) cool I will try that. Can we not plot any figures in general in a pod? Like, even if I try, will it always give an error? Or can I simply skip the plotting and run the rest of my code
nerdylive
nerdylive2mo ago
Running python -m tkinter from the command line should open a window demonstrating a simple Tk interface, letting you know that tkinter is properly installed on your system, and also showing what version of Tcl/Tk is installed, so you can read the Tcl/Tk documentation specific to that version. no need to install it. It is usually preinstalled by default. Make sure you write tkinter correctly (with capital letter T on versions less than python 3) while importing Wait what python version are you using?
TVC
TVC2mo ago
I ran the command python -m tkinter . I got this error /usr/bin/python: No module named tkinter
nerdylive
nerdylive2mo ago
python -m Tkinter try that
TVC
TVC2mo ago
Python 3.8.19 Same /usr/bin/python: No module named Tkinter
nerdylive
nerdylive2mo ago
sudo apt-get install python3.8-tk try
TVC
TVC2mo ago
Ok, it will install in all probability, but I will have to run my program to check if it fails. Let me get back in 2 mins Yes, it installed correctly
nerdylive
nerdylive2mo ago
Hmm? what do you mean python -m pip install module or if it doesnt works try
TVC
TVC2mo ago
Hi, this seems to have changed the error message, but the import error still persists Can we actually see any guis using the pods? Or is it purely a command line interface? I think comment out the line plt.figure() shown in this error log helped. I dont see an error, and hopefully my training goes through
nerdylive
nerdylive2mo ago
How about this? Hmm it cna be a gui but yeah ssh needs specific software too
TVC
TVC2mo ago
ERROR: Could not find a version that satisfies the requirement module (from versions: none)
ERROR: No matching distribution found for module
WARNING: There was an error checking the latest version of pip.
ERROR: Could not find a version that satisfies the requirement module (from versions: none)
ERROR: No matching distribution found for module
WARNING: There was an error checking the latest version of pip.
oh can you recommend what software will allow this? I am using vscode, and connecting using a regular ssh command. Does it need anything specific?
nerdylive
nerdylive2mo ago
No i don't, search it up Change the module
TVC
TVC2mo ago
Oh Still nothing I edited tkinter and Tkinter in place of module, but got the same error Can you help me with this?
nerdylive
nerdylive2mo ago
Hmm try searching your problem up on Google, I can't seem to find the solution yet hahah What is ur gui for? There is some templates for gui desktop like ubuntu Try searching on explore page on runpod
TVC
TVC2mo ago
Ok Cool, will do! For now I have generated all the GUI figures and plots, I'll try to view them locally on my system. I'll definitely look it up. Thanks for your help!
nerdylive
nerdylive2mo ago
Sure np
Want results from more Discord servers?
Add your server
More Posts