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 have a python script that I run as root and it works fine. When I try to run it with another user (not root) I use sudo command, but it doesn't work.

As root, I have typed:

 /usr/bin/python /somedir/someotherdir/myscript.py "some parameter"

It works!

As "A user" I have typed:

sudo /usr/bin/python /somedir/someotherdir/myscript.py "some parameter"

It doesn't works !?!?!?!

Python executes all right, but in some place of the script it looks like it cannot access some directory or get some library.

I have an entry in the /etc/sudoers file like this:

"A user" ALL = NOPASSWD: /usr/bin/python

It looks like sudo doesn't grant complete root access to "A user" to execute /usr/bin/python

Can you tell me what could be wrong ?

share|improve this question
User name can't have a space can it? "A user"? –  wojox Sep 23 '13 at 2:39
Please tell what do you mean by "It doesn't works !?!?!?!". Paste the error output, for example. –  oldherl Sep 23 '13 at 13:12

Your Answer


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

Browse other questions tagged or ask your own question.