0

I am absolute beginner for both Python and Clutter. I copied the following from from a website

import clutter

stage = clutter.Stage()
stage.set_size(400, 400)

label = clutter.Label()
label.set_text("Clutter Label Text")
# If no position is given it defaults to the upper most left corner.

stage.add(label)
stage.show_all()

clutter.main()

When I try this script to run it I am getting

AttributeError: 'module' object has no attribute 'Stage'

can any one help me on this?

Dinesh
  • 1,825
  • 5
  • 31
  • 40

1 Answers1

1

Make sure your script file name is not clutter.py.

If it is, rename it, and make sure there's no clutter.pyc in the same directory.

Otherwise, it prevents import of clutter module you want, but imports your own module.

falsetru
  • 357,413
  • 63
  • 732
  • 636
  • after changing the name of the file to GUIDemo.py I'm getting the real error ImportError: No module named clutter – Dinesh May 23 '14 at 15:29
  • @Dinesh, It means you didn't install clutter (at least to the python interpreter you're using) – falsetru May 23 '14 at 15:30
  • I am using Linux Mint OS. I tried with Synaptic Package manager in that there is libclutter-perl but not python. How should I install python clutter binding – Dinesh May 23 '14 at 15:30
  • @Dinesh: how to install something is an entirely separate question. – DSM May 23 '14 at 15:32
  • Thank you. I will raise as a separate question here http://stackoverflow.com/q/23833256/2243490 – Dinesh May 23 '14 at 15:32