sudo pip3 install & wrong permissions

Colin Watson cjwatson at ubuntu.com
Mon Jan 15 16:47:25 UTC 2018


On Mon, Jan 15, 2018 at 03:51:12PM +0000, Adam Funk wrote:
> When I install Python packages with `sudo -H pip3 install -U
> [packages]`, the files end up readable & executable by root only, so I
> have to do `sudo chmod -Rc a+rX /usr/local/lib/python*` afterwards to
> make them usable.
> 
> What exactly do I need to set to fix this, without compromising normal
> security?

If you need to use pip rather than relying on system packages, then I'd
strongly recommend doing so in conjunction with virtualenv.  That way
you don't have to drop things into /usr/local, and if you find that some
other thing you want to run needs a conflicting set of Python packages
(after all, you've had to do this job once, so why not a second time?)
then they can have environments that don't interfere with each other.

-- 
Colin Watson                                       [cjwatson at ubuntu.com]




More information about the ubuntu-users mailing list