0

I'm unable to understand the permission issues at the Python package level between superuser and user. My project depends on flask, flask-restful etc. I installed these packages as superuser (sudo su -) using pip install and they installed fine.

But when I try to import these packages, I get error that no module was found when invoking with user level vs no error at su level. Here is a snapshot:-

enter image description here

Doing the same thing with normal user privilige:- enter image description here

How do I solve this? I.e. I want to be able to access all package functionality from my user account.

Sam
  • 323
  • 2
  • 3
  • 8
  • Is flask in your 'sam' user's path? Try "import sys; sys.path" in an interactive interpreter with both users to see if there is any discrepancy. – corneria Feb 21 '17 at 18:19
  • What was your umask when you were installing the packages? Try `$ sudo umask`. – VPfB Feb 21 '17 at 19:49
  • @corneria sys.path gives me almost same result except for "pip-9.0.1-py3.4.egg" which is found in su path, but not at user level >>> sys.path ['', '/usr/lib/python3.4/site-packages/pip-9.0.1-py3.4.egg', '/usr/lib64/python34.zip', '/usr/lib64/python3.4', '/usr/lib64/python3.4/plat-linux', '/usr/lib64/python3.4/lib-dynload', '/usr/lib64/python3.4/site-packages', '/usr/lib/python3.4/site-packages'] – Sam Feb 21 '17 at 20:00

0 Answers0