Sample Header Ad - 728x90

Giving access to user-installed python distribution to another linux user

0 votes
1 answer
2828 views
(I'm not sure exactly what SE site my question belongs, I hesitated between stackoverflow, serverfault and superuser. Feel free to give suggestions about this in the comments.) Here is my problem: I have two users on my linux computer, bli and pquarato. bli installed python3.6 locally (compiling from source with ./configure --prefix=${HOME}). The binary is installed in /home/bli/bin, pip3.6 installs things in /home/bli/.local/lib/python3.6/site-packages. For instance, numpy is installed there: (bli) $ pip3.6 install numpy Requirement already satisfied: numpy in /home/bli/.local/lib/python3.6/site-packages I want pquarato to be able to use bli's python installation. bli did chmod -R a+rx on /home/bli/bin and /home/bli/.local. pquarato can use bli's python3.6 binary, but it is not able to import modules installed with pip3.6: (pquarato) $ /home/bli/bin/python3.6 -c 'import numpy' Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'numpy' The above works without errors for bli. What else should I do? ----- Note: I actually first ran into a problem when trying to get pquarato to use programs such as ipython3: (pquarato) $ /home/bli/.local/bin/ipython3 Traceback (most recent call last): File "/home/bli/.local/bin/ipython3", line 6, in from pkg_resources import load_entry_point File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3017, in @_call_aside File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside f(*args, **kwargs) File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3030, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 659, in _build_master ws.require(__requires__) File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 967, in require needed = self.resolve(parse_requirements(requirements)) File "/home/bli/lib/python3.6/site-packages/pkg_resources/__init__.py", line 853, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'ipython==6.2.1' distribution was not found and is required by the application I hope that the same solution will solve both the ModuleNotFoundError and the above DistributionNotFound issue.
Asked by bli (239 rep)
Apr 4, 2018, 11:57 AM
Last activity: Aug 6, 2025, 02:08 PM