Re: venv and executing other python programs

2022-02-17 Thread Martin Di Paola
That's correct. I tried to be systematic in the analysis so I tested all the possibilities. Your test results were unexpected for `python3 -m venv xxx`. By default, virtual environments exclude the system and user site packages. Including them should require the command-line argument `--system-

Re: venv and executing other python programs

2022-02-15 Thread Eryk Sun
On 2/15/22, Martin Di Paola wrote: > > That's correct. I tried to be systematic in the analysis so I tested all > the possibilities. Your test results were unexpected for `python3 -m venv xxx`. By default, virtual environments exclude the system and user site packages. Including them should requi

Re: venv and executing other python programs

2022-02-15 Thread Martin Di Paola
If you have activated the venv then any script that uses /usr/bin/env will use executables from the venv bin folder. That's correct. I tried to be systematic in the analysis so I tested all the possibilities. I avoid all these issues by not activating the venv. Python has code to know how

Re: venv and executing other python programs

2022-02-15 Thread Peter J. Holzer
On 2022-02-15 06:35:18 +0100, Mirko via Python-list wrote: > I have recently started using venv for my hobby-programming. There > is an annoying problem. Since venv modifies $PATH, python programs > that use the "#!/usr/bin/env python" variant of the hashbang often > fail since their additional mod

Re: venv and executing other python programs

2022-02-15 Thread Barry Scott
> On 15 Feb 2022, at 12:36, Martin Di Paola wrote: > > I did a few experiments in my machine. I created the following foo.py > > import pandas > print("foo") > > Now "pandas" is installed under Python 3 outside the venv. I can run it > successfully calling "python3 foo.py". > > If I add

Re: venv and executing other python programs

2022-02-15 Thread Barry
> On 15 Feb 2022, at 14:30, Mirko via Python-list > wrote: > > Well, it's not that I activate the venv *for* those troubling > programs. I activate it to work on the particular project. ;-) It is not necessary to activate the venv to use the python in it. So your solution is to not do the ac

Re: venv and executing other python programs

2022-02-15 Thread Mirko via Python-list
Am 15.02.2022 um 08:53 schrieb Barry Scott: > Or are you running the program from the command line after activating the > venv? This ... Am 15.02.2022 um 11:18 schrieb Roel Schroeven: > Suppose you're working on a program which, for example, prints json > to stdout. And suppose you want to use a

Re: venv and executing other python programs

2022-02-15 Thread Martin Di Paola
I did a few experiments in my machine. I created the following foo.py import pandas print("foo") Now "pandas" is installed under Python 3 outside the venv. I can run it successfully calling "python3 foo.py". If I add the shebang "#!/usr/bin/env python3" (notice the 3), I can also run it

Re: venv and executing other python programs

2022-02-15 Thread Chris Angelico
On Tue, 15 Feb 2022 at 21:19, Roel Schroeven wrote: > > Op 15/02/2022 om 8:21 schreef Reto: > > On Tue, Feb 15, 2022 at 06:35:18AM +0100, Mirko via Python-list wrote: > > > How to people here deal with that? > > > > Don't activate the venv for those programs then? > > The point of a venv is that y

Re: venv and executing other python programs

2022-02-15 Thread Roel Schroeven
Op 15/02/2022 om 8:21 schreef Reto: On Tue, Feb 15, 2022 at 06:35:18AM +0100, Mirko via Python-list wrote: > How to people here deal with that? Don't activate the venv for those programs then? The point of a venv is that you only enter it when you actually want that specific python stack. Get y

Re: venv and executing other python programs

2022-02-14 Thread Barry Scott
> On 15 Feb 2022, at 05:35, Mirko via Python-list > wrote: > > Hi, > > I have recently started using venv for my hobby-programming. There > is an annoying problem. Since venv modifies $PATH, python programs > that use the "#!/usr/bin/env python" variant of the hashbang often > fail since the

Re: venv and executing other python programs

2022-02-14 Thread Reto
On Tue, Feb 15, 2022 at 06:35:18AM +0100, Mirko via Python-list wrote: > How to people here deal with that? Don't activate the venv for those programs then? The point of a venv is that you only enter it when you actually want that specific python stack. Get yourself a terminal that can either mul

venv and executing other python programs

2022-02-14 Thread Mirko via Python-list
Hi, I have recently started using venv for my hobby-programming. There is an annoying problem. Since venv modifies $PATH, python programs that use the "#!/usr/bin/env python" variant of the hashbang often fail since their additional modules aren't install inside in venv. How to people here deal w