sudo pip3 install & wrong permissions
Colin Watson
cjwatson at ubuntu.com
Tue Jan 16 15:40:33 UTC 2018
On Tue, Jan 16, 2018 at 02:26:14PM +0000, Adam Funk wrote:
> On 2018-01-16, Colin Watson wrote:
> > You can symlink programs from the virtualenv's bin/ directory into some
> > directory on your $PATH and they should work.
> >
> >> Is it possible to set it up so scripts running in cron & at jobs have
> >> access to the libraries in the virtualenv?
> >
> > Normally speaking things like cron will be running a script in the
> > virtualenv, in which case they can just invoke it by its full path. If
> > you have more complicated requirements than that, then you can use
> ><path-to-virtualenv>/bin/python to invoke your scripts.
>
> I'll try it, thanks.
>
> For the most part, I was talking about cron/at jobs running in my own
> account, but I do have one that runs as root and imports the requests
> library. How should I handle that?
Well personally if that's all it is I'd just install python-requests or
python3-requests as appropriate, but if it requires a newer version or
similar then a root-owned virtualenv somewhere appropriate should work
fine.
--
Colin Watson [cjwatson at ubuntu.com]
More information about the ubuntu-users
mailing list