Python module Import error for one user but not th

2019-08-18 04:35发布

问题:

This works:

root@host#/usr/bin/python26 script.py 
Success

This results in an error:

user@host$/usr/bin/python26 script.py

ImportError: No module named OpenSSL 

The users have identical PYTHONPATHs. Why does the 2nd user fail to import the module?

回答1:

Ran chmod 755 on all directories in python path.

Non-root user was able to execute script after this.