[TriLUG] Python help?

Stephen Wiley via TriLUG trilug at trilug.org
Tue Oct 15 10:30:46 EDT 2024


I typically use the "env" binary in a shebang to run mine. If you write
all your scripts that way it will just use the shell search path which
the activate script should update so that your virtual environment bin
folder is first and you/the user won't have to care.

--Stephen

On Tue, Oct 08, 2024 at 03:01:12PM -0500, Alan Porter via TriLUG wrote:
> 
> The "python" executable inside the virtual environment has been altered to use a search path that only looks inside the venv.  So this should be sufficient.  I call python scripts inside venvs like this all the time.
> 
> ~ alan
> 
> 
> 
> > On Oct 8, 2024, at 2:16 PM, Cristóbal Palmer via TriLUG <trilug at trilug.org> wrote:
> > 
> > On Tue, Oct 8, 2024, at 14:59, Brian McCullough via TriLUG wrote:
> >> 
> >> venv/bin/python app.py
> > 
> > This rings an alarm bell for me, because it is (depending on the context/environment) not sufficient to actually load the venv.
> > 
> > In contexts where I call a python script that requires libs added via pip in a venv, I always have a shell wrapper that calls the ‘activate’ script for the venv
> > 
> > Warmly,
> > CMP
> > --
> > This message was sent to: Alan Porter <porter at trilug.org>
> > To unsubscribe, send a blank message to trilug-leave at trilug.org from that address.
> > TriLUG mailing list : https://www.trilug.org/mailman/listinfo/trilug
> > Unsubscribe or edit options on the web    : https://www.trilug.org/mailman/options/trilug/porter%40trilug.org
> > Welcome to TriLUG: https://trilug.org/welcome
> 
> -- 
> This message was sent to: Stephen Wiley <swiley at swiley.net>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that address.
> TriLUG mailing list : https://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web	: https://www.trilug.org/mailman/options/trilug/swiley%40swiley.net
> Welcome to TriLUG: https://trilug.org/welcome



More information about the TriLUG mailing list