0

I asked this question on how to get python to work in my Ubuntu Terminal. After trying python file.pyw. I was then given this error in the terminal: importerror: no module named _tkinter, please install the python-tk package. I searched for this in google and ran accross this on stackoverflow. However when i run that in the terminal I get

E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied_
E: Unable to lock administration directory, are you root?  I am root.

Where do I go from here?

user9447
  • 1,895
  • 5
  • 26
  • 40

1 Answers1

2

You have to run this command as super user. Try the following:

sudo apt-get install python-tk

This should fix your problem. The magic extra thing to type is the sudo command. This will trigger a password prompt and after you've correctly entered your password the command following sudo (in this case apt-get install python-tk) will be run under administrative privileges.

bender
  • 1,804
  • 15
  • 24
  • Hmm, was this really the issue? OP states "I am root." in the question. – gertvdijk Jan 17 '13 at 21:30
  • Any better suggestion? Or do you think that the fact that he accepted my answer isn't obvious enough? To reproduce the error, simply enter the command in your terminal without `sudo` and see what happens :-) – bender Jan 17 '13 at 21:46
  • Should have commented to the OP instead, sorry. If this worked, then the OP *wasn't* root. – gertvdijk Jan 17 '13 at 21:48