sudo pip3 install & wrong permissions

Adam Funk a24061 at ducksburg.com
Thu Jan 18 12:53:20 UTC 2018


On 2018-01-16, Colin Watson wrote:

> 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.

That was a bad example --- I think the version in python3-requests is
fine --- so I probably don't need to worry about that after all.





More information about the ubuntu-users mailing list