Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 1 down vote accepted

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.

share|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.