Python imports working for root, but not specific user


Jan D
25/12/2015 9:47 am
HOME » Unix

I'm trying to run a python script through a user account, call it myuser. I want to be able to execute the dropbox.py script without logging into or su'ing into root. The program works perfectly when I am either logged in as root, or su'd into root, but I want to find a way to not have to su over to root and then run it every time I start up.

When I run it as myuser, I get the following error:

[myuser@localhost Utilities]$ python dropbox.py start
Starting Dropbox...
The Dropbox daemon is not installed!
Run "dropbox start -i" to install the daemon

So, I run it with the -i option, as recommended and get the following:

[myuser@localhost Utilities]$ python dropbox.py start -i
Starting Dropbox...Traceback (most recent call last):
  File "dropbox.py", line 1404, in start
    download()
  File "dropbox.py", line 280, in download
    import pygtk
ImportError: No module named pygtk

I ran it with strace and I get line after line that looks roughly like this:

open("/home/myuser/Downloads/pygtk.so", O_RDONLY) = -1
ENOENT (No such file or directory)

There are no differences in the .bashrc, .bash_profiles, .bash_history files of either profile. I also checked the .config folder for differences and found none.

Again, the weirdest thing is that it works fine as root, but it doesn't work when logged in as myuser. root is having no problem at all importing in the elusive pygtk package.

Is there some kind of python permission(s) or configuration I need to set somewhere to allow other users to import packages? Is there a configuration setting of some kind I am missing in the myuser account?

Thanks!


Related to : Python imports working for root, but not specific user
Python imports working for root, but not specific user
25/12/2015 9:47 am by Jan D in Unix

I'm trying to run a python script through a user account, call it myuser. I want to be able to execute the dropbox.py script without logging into or su'ing into root. The program works perfectly when I am either logged in as root, or su'd into root, but I want to find a way to not have to su over


Why does a specific import sees other imports? Python 2.6
by stargazr in Unix

I have two files. SysDump.py which does from libApi import _SysDump and in the other file libApi.py I have many classes and one of them is


class _SysDump():
import cPickle as _cPickle
import math as _math
from zipfile import ZipFile as _ZipF
python imports suddenly not working
by Sigtryggur in Unix

I had everything installed good on my laptop. Everything was working. Today when i wanted to work with my projects again just everything suddenly gives an error on imports. It's not just one package, but multiple. The only thing I could think of is Windows Update, but actually I doubt this would


datetime imports not working (python with Django)
by CraKaJaX in Unix

This is weird, but datetime seems not to be working


I am trying to follow the django tutorial, (chapter 3, http://www.djangobook.com/en/2.0/chapter03.html). But the code further below throws a syntax error:
undefined variable from import: datetime


It does not like th


Python Module Imports - Explicit vs Implicit Relative Imports
by Bjørn Håkon in Unix
Last night, when working on my mac, I set up some module imports in my __init__.py'sfrom MongoProvider import MongoProviderfrom Settings import Settingsetc. I'm unsure of what version of Python is on that machine. I'll edit the question later with that info once I have it.Today, working on a differe
Which is the best method to create Daemon on? (As a root user Or as a specific user))
by patheems in Unix
I want to create Daemon on Ubuntu.
But I am confuse about what will be the best access level.
i.e should I install daemon as root user or specific user.
As I am new to this technology I want to know that,
In general Which method does Developer's prefer?
As my requirement is
When I SSH into my raspberry with a specific user, it always logs in as root instead of that user
8/12/2014 7:10 am by NeoTubNinja in Unix

It's 3 in the morning, I'm half asleep and I have no idea what I have done.

Whenever I log in through SSH, or even when I log in on the raspberry's terminal, it always logs in as root, instead of that user.

I have two users, the one I work with and the default "pi" user, which I n


How to allow a non-root user to mount a specific filesystem?
by luci5r in Unix
Hi all,
I want to allow a specific user to manually mount a specific filesystem on RHEL6
I know I could do this using sudo, but I would like to explore any other possible way.
May I use zsh shell to invoke root script with setuid bit?
Could you please provide me any example?
TAGS: allow root user mount specific filesystem
Give root privileges to an user just for a specific directory
27/11/2014 10:07 am by Riparian in Unix

I have have a web server running on my machine and I would like to give the 2 users, misterX and misterY, root privileges for the directory /var/www so that they can also edit the files that are being created by other users and/or scripts.


romantic gesture - give root access to specific user - please help!
by AtenRa in Unix
I'd like to do something romantic for my programmer boyfriend. I've bought him a bonsai with exposed roots, and I want to attach a label indicating that I'm giving him root access to... me.
What would be the most elegant way to give a specific user full permissions recursively, but not exclusi
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .