Python Forum

Full Version: ImportError: cannot import name 'gui' from 'appJar'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to use appJar for some simple GUI, but the import function doesn't work. Does anyone know how I can fix it?
The code is taken from "http://appjar.info/pythonWidgetLayout/".
from appJar import gui  

def changeLabel(btn):  
    app.setLabel("l2", app.getEntry("text"))  

app = gui()  
app.addLabel("l1", "Simple Demo")
app.addEntry("text")
app.addButton("OK", changeLabel)
app.addEmptyLabel("l2")
app.go()
Typically, such errors could happen if you create yourself a file named appJar.py on the python path that shadows the actual appJar module. What is the result of
import appJar
print(appJar)