** Summary changed: - python sys.path different per user account - ImportError no module named (Focal) + python sys.path different per user account - ImportError no module named (Focal and Bionic Beaver)
-- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to python2.7 in Ubuntu. https://bugs.launchpad.net/bugs/1869115 Title: python sys.path different per user account - ImportError no module named (Focal and Bionic Beaver) Status in python2.7 package in Ubuntu: New Bug description: In Ubuntu 20.04, python scripts executed by other users or users that cannot log in (/usr/sbin/nologin as their shell) do NOT work when importing modules that have been installed via python packages via apt or pip due to sys.path returning different values. For example, I have a PAM python script that is used for authentication, and when it is run, it fails because it cannot find some of the modules it needs. Further investigation shows that my current logged in user (running the script via the terminal) has a sys.path value of: /current/directory/user/is/in /usr/lib/python2.7 /usr/lib/python2.7/plat-x86_64-linux-gnu /usr/lib/python2.7/lib-tk /usr/lib/python2.7/lib-old /usr/lib/python2.7/lib-dynload /usr/local/lib/python2.7/dist-packages /usr/lib/python2.7/dist-packages When I run the same script with another user: /usr/lib/python2.7 /usr/lib/python2.7/plat-x86_64-linux-gnu /usr/lib/python2.7/lib-tk /usr/lib/python2.7/lib-old /usr/lib/python2.7/lib-dynload Two critical paths are missing for this user! They are: /usr/local/lib/python2.7/dist-packages /usr/lib/python2.7/dist-packages Why are these two paths not included for this particular user? I don't have this problem in older versions of Ubuntu. The same python script works in 18.04, but fails in 20.04. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/1869115/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : [email protected] Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp

