sudo pip3 install & wrong permissions

Adam Funk a24061 at ducksburg.com
Tue Jan 16 14:26:14 UTC 2018


On 2018-01-16, Colin Watson wrote:

> On Tue, Jan 16, 2018 at 12:01:44PM +0000, Adam Funk wrote:
>> I think this is probably a smart idea.  I've recently started using
>> virtualenv (combined with screen over ssh) on a server at work, but
>> I've been running experiments in the same screen session for a while
>> so I haven't had to re-enable it.
>> 
>> Is it possible to set virtualenv up so that when I open an xterm it
>> will have everything set up so my scripts will run right away?
>
> 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?





More information about the ubuntu-users mailing list