# Python venv works, but not from script?

**URL:** https://forum.maboxlinux.org/t/python-venv-works-but-not-from-script/2522
**Category:** Technical Issues
**Created:** [May 21, 2026, 1:57am UTC](https://forum.maboxlinux.org/t/python-venv-works-but-not-from-script/2522 "2026-05-21T01:57:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rdtsc](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/rdtsc/32/2168_2.png) [@rdtsc](https://forum.maboxlinux.org/u/rdtsc)
#### Post date: [May 21, 2026, 1:57am UTC](https://forum.maboxlinux.org/t/python-venv-works-but-not-from-script/2522/1 "2026-05-21T01:57:48Z")

</div>

Odd one here. This worked before, but something has changed, perhaps upstream, perhaps in how `source` or the shell works.

If we go into a directory (lets call it `foo`) and do a `python -m venv venv` or `virtualenv venv` (if installed), the `venv` directory is created and contains `venv/bin/activate`. While in this terminal, can do `source venv/bin/activate` and it works (the python virtual environment is loaded and we get the `(venv)` prompt.) Then `deactivate` works.

But if a bash script named `start` is created here in `foo`, set executable, and contains `source venv/bin/activate`, this silently fails and we do not get the `(venv)` prompt. Tried many combinations of no/relative/full path, no/bash/env bash shebang, etc. It always just silently fails.

This worked awhile ago. Any ideas what changed, and what we can do to start a venv from a script?

---

<div class="post-metadata">

### Author: ![muzqs](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/muzqs/32/3702_2.png) [@muzqs](https://forum.maboxlinux.org/u/muzqs)
#### Post date: [May 21, 2026, 6:18am UTC](https://forum.maboxlinux.org/t/python-venv-works-but-not-from-script/2522/2 "2026-05-21T06:18:31Z")

</div>

Hi @rdtsc

Not really my area, but from what I can tell the fix is to run the script with `source` instead of executing it directly:

```auto
source ./start

```

or the shorthand:

```auto
. ./start

```

From what I am reading the behavior you are facing is normal.

Hope that helps!
