MySQLdb will only import for root

Jeffrey Froman jeffrey at fro.man
Fri Jul 11 09:29:16 EDT 2008


Diez B. Roggisch wrote:

>> Is it possible the module was installed with priviledges set too
>> strict?  Perhaps the interpreter cannot see the module when it is run
>> from a normal user account.
> 
> Possible - certainly. Yet unrealistic, because usually root access is
> required to system-wide install a package - thus the normal install
> processes ensure proper rights.

According to the OP, it is root that *does* have access to MySQLdb and a
normal user that does not. It is a very realistic possibility to install
something as root to which normal users do not have access. Installation
scripts that assume a particular umask during install, for example, are
especial culprits.

I have noticed this problem myself with python modules that include compiled
C extensions, as MySQLdb does. However, in the case where the extension
module itself has incorrect permissions, the error would point to a missing
_mysql, rather than a missing MySQLdb.


Jeffrey



More information about the Python-list mailing list