Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #197396
| From | Thomas Passin <list1@tompassin.net> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Pip installs to unexpected place |
| Date | 2025-04-14 23:11 -0400 |
| Message-ID | <mailman.4.1744688909.3008.python-list@python.org> (permalink) |
| References | (2 earlier) <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> |
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.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
Re: Pip installs to unexpected place Thomas Passin <list1@tompassin.net> - 2025-04-14 09:55 -0400
Re: Pip installs to unexpected place rbowman <bowman@montana.com> - 2025-04-14 21:56 +0000
Re: Pip installs to unexpected place Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-14 15:31 -0700
Re: Pip installs to unexpected place Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-04-14 15:20 -0700
Re: Pip installs to unexpected place rbowman <bowman@montana.com> - 2025-04-15 01:12 +0000
Re: Pip installs to unexpected place Thomas Passin <list1@tompassin.net> - 2025-04-14 23:11 -0400
Re: Pip installs to unexpected place Thomas Passin <list1@tompassin.net> - 2025-04-14 21:51 -0400
csiph-web