0

I am using a Raspberry Pi and the lite version of the OS. My goal is to run a python script using customtkinter. As I am using the lite-version of the OS, I run the script with xorg and openbox (tutorial: https://forums.raspberrypi.com//viewtopic.php?t=152264)

Executing the file that runs my script in openbox, I get the following error:

ModuleNotFoundError: No module named 'customtkinter'

Customtkinter is installed.

The python script itself is executable, if I try running the .py file itself, I get the following error:

tkinter.TclError: no display name and no $DISPLAY environment variable

That means, the file itself doesn't have the problem of importing customtkinter as the above error is caused in line 35 and I'm importing customtkinter in line 2.

So somehow running the file in openbox causes the problem of not finding the customtkinter module. How can I fix this? PS: There is no problem importing other libraries such as Tkinter

johschEleven
  • 1
  • 1
  • 2
  • It is working for me. Please check if you're using any virtual environment (if yes, then please activate them and work with it). If still you're getting error, please share the steps of your installation and then add screenshots if possible. – amrs-tech Aug 10 '23 at 12:01
  • I'm not using any virtual environment (I guess?!). You did the exact same thing with customtkinter and it works just fine? – johschEleven Aug 10 '23 at 12:51
  • Can you try setting your DISPLAY environment and see if that works? Run this on the command line. export DISPLAY=:0.0 – hikerjobs Aug 10 '23 at 14:28
  • If I run "export DISPLAY=:0.0" and try to execute my python programm directly in the command line, I get the error "tkinter.TclError: couldn't connect to display ':0.0'". No differences running the code in openbox. – johschEleven Aug 10 '23 at 14:59

0 Answers0