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: ERROR IN DOWNLOADING PYTHON

2022-02-15 Thread Eryk Sun
On 2/15/22, 11_Anindita Das_BCA wrote: > > I have downloaded the latest 3.10.2 version of python for my 64×64 bit > laptop but I'm unable to work on it as my system is showing that > api-ms-win-crt-runtime-l1-1-0-dll is missing but it's not the case as i > have also downloaded this file. I guess

ERROR IN DOWNLOADING PYTHON

2022-02-15 Thread 11_Anindita Das_BCA
Dear Sir/Mam I have downloaded the latest 3.10.2 version of python for my 64×64 bit laptop but I'm unable to work on it as my system is showing that api-ms-win-crt-runtime-l1-1-0-dll is missing but it's not the case as i have also downloaded this file. Please let me know what should be my immediate

Re: Saving/exporting plots from Jupyter-labs?

2022-02-15 Thread Martin Schöön
Den 2022-02-15 skrev Reto : > On Mon, Feb 14, 2022 at 08:54:01PM +, Martin Schöön wrote: >> 1) In notebooks I can save a plot by right-clicking on it and do >> save image as. In Jupyter-lab that does not work and so far I >> have not been able to figure out how to do it. Yes, I have looked >> i

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