Deutsch   English   Français   Italiano  
<mailman.4.1744688909.3008.python-list@python.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: Thomas Passin <list1@tompassin.net>
Newsgroups: comp.lang.python
Subject: Re: Pip installs to unexpected place
Date: Mon, 14 Apr 2025 23:11:58 -0400
Lines: 29
Message-ID: <mailman.4.1744688909.3008.python-list@python.org>
References: <CAApdmf2J69WgkR159sBSkxN0=mYoNmHZYboBmpPi+LdA-YBNpg@mail.gmail.com>
 <020e0ef5-3d53-4f9c-acb5-842a1a971b10@tompassin.net>
 <CAApdmf0+91Br19ZTa5sh0CLywWhD6wyL5Ou9118cF8D==edJBg@mail.gmail.com>
 <45c52b56-eb57-4d54-9f91-bee30280d16f@tompassin.net>
 <mailman.3.1744659206.3008.python-list@python.org>
 <87lds22xnm.fsf@nosuchdomain.example.com>
 <70582937-6fc3-4458-a230-e8bddcfa4006@tompassin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de V5Ty0RS1FTKlZFeZSlpy9QdxoMUNID+AU7LlP9hh3Olg==
Cancel-Lock: sha1:nHY0HpihACZwsSjhTIJvSVODMo8= sha256:pC0R8wVf4KrzlJIjAaGe1wj6VBH594LG5jXknrAEaTs=
Return-Path: <list1@tompassin.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
 reason="2048-bit key; unprotected key"
 header.d=tompassin.net header.i=@tompassin.net header.b=vOt8RpJy;
 dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.011
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'linux': 0.09;
 'received:23.83.212': 0.09; 'received:elm.relay.mailchannels.net':
 0.09; 'writes:': 0.09; 'that.': 0.15; 'executable': 0.16; 'flag.':
 0.16; "hadn't": 0.16; 'received:10.0.0': 0.16; 'received:64.90':
 0.16; 'received:64.90.62': 0.16; 'received:64.90.62.162': 0.16;
 'received:dreamhost.com': 0.16; 'script,': 0.16; 'script.': 0.16;
 'undo': 0.16; 'wrote:': 0.16; 'probably': 0.17; 'pm,': 0.19;
 'to:addr:python-list': 0.20; 'run': 0.23; '(and': 0.25; "wasn't":
 0.26; 'environment': 0.29; 'it,': 0.29; 'header:User-Agent:1':
 0.30; 'looked': 0.31; 'marked': 0.32; 'python-list': 0.32;
 'received:10.0': 0.32; 'received:mailchannels.net': 0.32;
 'received:relay.mailchannels.net': 0.32; 'right,': 0.32; 'but':
 0.32; 'mark': 0.32; 'script': 0.33; 'header:In-Reply-To:1': 0.34;
 'windows': 0.34; 'source': 0.36; 'prompt': 0.39; 'received:100':
 0.39; 'your': 0.64; 'required': 0.65; 'header:Received:6': 0.67;
 'received:64': 0.68; 'that,': 0.68; 'content.': 0.70; 'risk':
 0.71; "you'll": 0.73; 'forgot': 0.84; 'activate': 0.91
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1744686721; a=rsa-sha256;
 cv=none;
 b=Cl7C0V4owuCa9IX0cN12qYGGdq4kentk2S3YDB5CK+jqX9zSxokJRtwTZmy6WEHNPaiMTK
 xrButI4z3pwN/rjTjrLvO93hcwNtPy0SOGf9pup+L2lq7zqlnsC2GLCkB6L+N/RIuyrB4I
 IJRFM750whpt5Yah6dpXb2E+5KrPY0m2VHd8lLYmOKJVW+wJwVDFlR11eY28qWdJHsEU0J
 hZYSUDGNuaHjtFEftnZJHnlO4ChZ+AwxEe4rVF/pPmqQX2X6K5h2Wlz6iDTs5C2BBm1czM
 koaC5l5lixEO9zqpeUWboqxQptn5spT3slrU6Q0LgJSpoCxk6CCGGu44sA8c+Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1744686721;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=SYLCY26mcGa2j16wDU5I3Rc1qiVW51kLBeFYeIG/hOQ=;
 b=Xx5zUBnr4sTUub0cez+EDdpGULq0U4gFuAfL7qQQr4ocjyblL0DytIMorcPYgPCLN6YrUP
 e3l370U0Uta43FH5OwhbSgaJYXKjksGnX4/T1GHLczlXblMfH5iKqPoTamqcBrSRZXfeDz
 6VtSQioF9piGoC4mLDNjiYlUvaKGKQr5Rv16YuaKpqtmkIGNuTDzZMtK4lrLh1bWNWT2RN
 ZQ5s346bU60U+kYYkrB/FDT667oui3bEONy/VqLRW2fxwaAwwIqxJG6cbCEhrm/TlA0qOb
 CAlTics9hwI3VqAQ+Rurd2myoLmOBGb9v5wZOdbniM5/1VWNeWL5pBs7J13t8Q==
ARC-Authentication-Results: i=1; rspamd-67f59c8b45-rr4bd;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id: dreamhost
X-Spot-Shoe: 1449bc0f0163b098_1744686721492_3067920356
X-MC-Loop-Signature: 1744686721492:2099025696
X-MC-Ingress-Time: 1744686721492
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net;
 s=dreamhost; t=1744686721;
 bh=SYLCY26mcGa2j16wDU5I3Rc1qiVW51kLBeFYeIG/hOQ=;
 h=Date:From:Subject:To:Content-Type:Content-Transfer-Encoding;
 b=vOt8RpJyUk7qzP2Qh35Ml53V+zdY/lwKcP6iFXcDVmhZaP2aNwufyRCk+bLDsv9yF
 h6QEor5BTeb88VoyFQSenJhLYR3AvTX5XHfbzrcmGvF+kPkOOBztApKIYoS/oqtHD5
 4LazCaKse9ddCV3CD9+jAi9LquJF3Q5fc+RJBVTMw/CZ75ut/HWHhd34rVBWl2MEl0
 DQTVBMwFQKcChPyCLOaIIiSIndIuN+nOyphfWHIhWE13BkweGyVDdsokVaxbtI/TKe
 OlyD2C1vUOHKceXy0b2bETpXnx2U1CiWjqMBrxsYy0NGlQTONa7WYebgYmLQ4aF3vb
 W0uCpU5wja+HA==
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <87lds22xnm.fsf@nosuchdomain.example.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
 <python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
 <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
 <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <70582937-6fc3-4458-a230-e8bddcfa4006@tompassin.net>
X-Mailman-Original-References: <CAApdmf2J69WgkR159sBSkxN0=mYoNmHZYboBmpPi+LdA-YBNpg@mail.gmail.com>
 <020e0ef5-3d53-4f9c-acb5-842a1a971b10@tompassin.net>
 <CAApdmf0+91Br19ZTa5sh0CLywWhD6wyL5Ou9118cF8D==edJBg@mail.gmail.com>
 <45c52b56-eb57-4d54-9f91-bee30280d16f@tompassin.net>
 <mailman.3.1744659206.3008.python-list@python.org>
 <87lds22xnm.fsf@nosuchdomain.example.com>

On 4/14/2025 6:20 PM, Keith Thompson via Python-list wrote:
> Thomas Passin <list1@tompassin.net> writes:
> [...]
>> To activate a venv, you have to source its activate script, which is
>> in the venv. First you have to mark it as executable.  Then you source
>> it -
>>
>> source ~/venv/gf4/bin/activate
> [...]
> 
> No, you don't have to (and probably shouldn't) mark the script as
> executable.
> 
> Making a script executable (chmod +x) is required before *executing* it,
> but when you *source* a script (using "source" or "."), your current
> shell reads it and evaluates its content.
> 
> Making the active script executable introdues the risk that you'll
> accidentally execute it rather than sourcing it.  If you do that, it
> will probably set up the environment in a new shell process which then
> immediately terminates.

You are right, my bad.  When I went to check on what the venv prompt 
looked like after activation, I hadn't run my Linux VM for too long and 
forgot that the activate script needs to be sourced - in Windows it just 
gets run as any other script. I noticed it wasn't marked executable and 
blindly "fixed" that.  Then of course I remembered the script has to be 
sourced  - and forgot to undo the execute flag.