Re: Pip installs to unexpected place

Liste des GroupesRevenir à cl python 
Sujet : Re: Pip installs to unexpected place
De : list1 (at) *nospam* tompassin.net (Thomas Passin)
Groupes : comp.lang.python
Date : 15. Apr 2025, 02:51:08
Autres entêtes
Message-ID : <mailman.5.1744696569.3008.python-list@python.org>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
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.

Date Sujet#  Auteur
14 Apr 25 * Re: Pip installs to unexpected place7Thomas Passin
14 Apr 25 +* Re: Pip installs to unexpected place2rbowman
14 Apr 25 i`- Re: Pip installs to unexpected place1Keith Thompson
14 Apr 25 `* Re: Pip installs to unexpected place4Keith Thompson
15 Apr 25  +- Re: Pip installs to unexpected place1rbowman
15 Apr 25  +- Re: Pip installs to unexpected place1Thomas Passin
15 Apr 25  `- Re: Pip installs to unexpected place1Thomas Passin

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal