Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.