Nп/п : 48 из 100
 От   : dn                                  2:5075/128        28 сен 23 11:42:36
 К    : All                                                   28 сен 23 01:46:02
 Тема : Re: path to python in venv
----------------------------------------------------------------------------------
                                                                                 
@MSGID:
<mailman.364.1695854571.23016.python-list@python.org> b9c0e9b2
@REPLY:
<b06e1bc1-7e26-437a-b73d-741edab40e1e@DancesWithMice.info> 493c12e6
@REPLYADDR dn <PythonList@DancesWithMice.info>
@REPLYTO 2:5075/128 dn
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID:
<mailman.364.1695854571.23016.python-list@python.org>
@RFC-References:
fnKwpp_P8PtKFYVsDOUKBcB-d66qG8_A@mail.gmail.com> <mailman.356.1695840877.23016.python-list@python.org>
<slrnuh8un7.78e.jon+usenet@raven.unequivocal.eu> fug8Mb+hA@mail.gmail.com>
<mailman.358.1695844007.23016.python-list@python.org> <slrnuh94ap.78e.jon+usenet@raven.unequivocal.eu>
<b06e1bc1-7e26-437a-b73d-741edab40e1e@DancesWithMice.info>
@TZUTC: 1300
@PID: Mozilla Thunderbird
@TID: FIDOGATE-5.12-ge4e8b94
On 28/09/2023 09.32, Jon Ribbens via Python-list wrote:
> On 2023-09-27, Larry Martell <larry.martell@gmail.com> wrote:
>> On Wed, Sep 27, 2023 at 12:42 PM Jon Ribbens via Python-list
>> <python-list@python.org> wrote:
>>> On 2023-09-27, Larry Martell <larry.martell@gmail.com> 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
>>> ...
>>>> Not sure what this really means, nor how to get python to be in my venv.
>>>
>>> WHy do you want python to be "in your venv"?
>>
>> Isn`t that the entire point of a venv? To have a completely self
>> contained env? So if someone messes with the system python it will not
>> break code running in the venv.

> The main point of the venv is to isolate the installed packages,
> rather than Python itself. I`m a bit surprised your symlinks are
> as shown above though - mine link from python to python3.11 to
> /usr/bin/python3.11, so it wouldn`t change the version of python
> used even if I installed a different system python version.


"venv -- Creation of virtual environments" 
(https://docs.python.org/3/library/venv.html) starts by saying:

< each with their own independent set of Python packages installed in 
their site directories.>>

but later expands this with: < interpreter...>> even though the primary use-case treats the system 
interpreter as the "base" Python/environment.

Time for some reading and proving appropriate combinations of options?


Over the years there have been various proposals to enable multiple 
versions of Python to exist concurrently on a single machine, notably 
Python2 + Python3 - but am failing to recall any official docs on 
Python3.n + Python3.m; eg "PEP 554 - Multiple Interpreters in the 
Stdlib" (https://peps.python.org/pep-0554/).

That said there`s plenty of articles on-line (which may/not feature 
venv*) such as "Multiple Python interpreters" 
(https://developer.fedoraproject.org/tech/languages/python/multiple-pythons.html
)

* although the OP didn`t mention an OpSys, one poster did mention 
Fedora-Linux...


NB some of this info may be dated - it is some time since conducted this 
investigation (and decided not to use venv - apologies!)

Am currently using PyCharm (courtesy of recent teams` conventions) and 
it eases both problems (which interpreter, and which 
development-environment/activation steps) but in automating `the boring 
stuff` it will be interesting to see if in-future, I notice when the 
project is based upon an older system!
FYI 
https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-reloading-int
erpreter-paths.html
(I`d be surprised if the other major tool-sets don`t offer something 
similar)

Disclaimer: JetBrains sponsor our local PUG-meetings with a door-prize.

-- 
-- 
Regards,
=dn
--- Mozilla Thunderbird
 * Origin: DWM (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    
                                                                                
В этой области больше нет сообщений.

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