Skip to content Skip to sidebar Skip to footer

Can I Use Pip Install To Install A Module For Another Users?

I'm wish to install Numpy for the www-data user, but I can not log into this user using login. How can I make www-data make us of the Numpy module? To clarify. Numpy is available f

Solution 1:

Running pip with sudo should install a package for all users

sudo pip install numpy

If it doesn't work, try

sudo -H -u www-data pip install --user numpy

which should install numpy only for www-data


Solution 2:

you will find your answer here :

pip install --user numpy

Solution 3:

Another option would be to switch to that user and run it with

pip install --user package

There is that one issue (you probably ran into) that you cant switch to some users because some users have nologin shell. But you can always switch to that user passing shell you want like this:

sudo su -s /usr/bin www-data


Post a Comment for "Can I Use Pip Install To Install A Module For Another Users?"