Nп/п : 50 из 100
 От   : Thomas Passin                       2:5075/128        27 сен 23 20:28:17
 К    : All                                                   27 сен 23 03:33:02
 Тема : Re: path to python in venv
----------------------------------------------------------------------------------
                                                                                 
@MSGID:
<mailman.366.1695860904.23016.python-list@python.org> 82c6f452
@REPLY:
<e61f0d6a-b546-3477-10ba-8a9b9188efb3@tompassin.net> 06cd1d45
@REPLYADDR Thomas Passin <list1@tompassin.net>
@REPLYTO 2:5075/128 Thomas Passin
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID:
<mailman.366.1695860904.23016.python-list@python.org>
@RFC-References:
fnKwpp_P8PtKFYVsDOUKBcB-d66qG8_A@mail.gmail.com> <e61f0d6a-b546-3477-10ba-8a9b9188efb3@tompassin.net>
@TZUTC: -0400
@PID: Mozilla/5.0 (Windows NT 10.0; Win64; x64;
rv:102.0) Gecko/20100101 Thunderbird/102.15.1
@TID: FIDOGATE-5.12-ge4e8b94
On 9/27/2023 2:53 PM, Larry Martell via Python-list wrote:
> I was under the impression that in a venv the python used would be in
> the venv`s bin dir. But in my venvs I see this in the bin dirs:

> lrwxrwxrwx 1 larrymartell larrymartell    7 Sep 27 11:21 python -> python3
> lrwxrwxrwx 1 larrymartell larrymartell   16 Sep 27 11:21 python3 ->
> /usr/bin/python3

> Googling this I read:

> The presence of symbolic links like python and python3 in the bin
> directory of your virtual environment pointing to the system Python
> executable (/usr/bin/python) suggests that the virtual environment was
> created using the system Python interpreter rather than a standalone
> Python installation.

> This can happen if you create a virtual environment using a
> system-wide Python interpreter, and the virtual environment inherits
> some of the symbolic links or shortcuts from the system Python
> installation. In this case, your virtual environment is not fully
> isolated because it still relies on the system Python interpreter.

> Not sure what this really means, nor how to get python to be in my venv.

You don`t need to "get python to be in my venv".  The venv contains its 
own Python Lib directory, and whatever site-packages installs you want 
for that venv.  In essence, the script for launching the venv sets up 
the PYTHONPATH variable and some other paths so that Python finds its 
files in the venv directories instead of in the usual Python locations. 
Setting these paths may involve creating symbolic links and that is all 
done for you.

The thing you need to appreciate is that when you create a venv with a 
command like this:

 -m venv path/to/venv

this will all link back to whatever version of Python you used in place 
of .  If you invoked it with python3, on Linux you will get 
whatever your system runs when you type "python3", which would usually 
be the system`s Python install.  If you want to use some other version 
of Python, say python3.10, then just run that one instead when you 
create the venv.

 --- Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
 * Origin: usenet.network (2:5075/128)
SEEN-BY: 50/109 301/1 467/888 4500/1 5000/111
5001/100 5005/49 5020/715 830
SEEN-BY: 5020/848 1042 4441 12000 5030/49 1081
5054/8 5061/133 5075/128
SEEN-BY: 5080/102 5083/1 444
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх