[GH-ISSUE #1765] Environment does not support python -m venv #860

Closed
opened 2026-03-01 21:46:57 +03:00 by kerem · 2 comments
Owner

Originally created by @ggoretkin-bdai on GitHub (Apr 25, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1765

Bug report info

$ gh act --bug-report
act version:            0.2.44
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/ggoretkin/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.18.10
	Module path:           github.com/nektos/act
	Main version:          (devel)
	Main path:             github.com/nektos/act
	Main checksum:         
	Build settings:
		-compiler:            gc
		CGO_ENABLED:          0
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
		vcs:                  git
		vcs.revision:         65088b8f28d44da128b95ec194a04277b8856be9
		vcs.time:             2023-01-20T18:39:07Z
		vcs.modified:         true
Docker Engine:
	Engine version:        20.10.21
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         systemd
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Ubuntu 22.04.2 LTS
	OS type:               linux
	OS version:            22.04
	OS arch:               x86_64
	OS kernel:             5.19.0-40-generic
	OS CPU:                16
	OS memory:             15699 MB
	Security options:
		name=apparmor
		name=seccomp,profile=default
		name=cgroupns




### Command used with act

```sh
gh act -W .github/workflows/black.yaml


### Describe issue

The workflow completes on `github.com`, so I expect it to work the same on my local system.

| The virtual environment was not created successfully because ensurepip is not
| available. On Debian/Ubuntu systems, you need to install the python3-venv
| package using the following command.
|
| apt install python3.10-venv
|
| You may need to use sudo with that command. After installing the python3-venv
| package, recreate your virtual environment.



See also https://github.com/nektos/act/issues/925

### Link to GitHub repository

https://github.com/ggoretkin-bdai/ggoretkin-gh-act-black-local-test

### Workflow content

```yml
name: Black

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: psf/black@stable


### Relevant log output

```sh
$ gh act -W .github/workflows/black.yaml 
[Black/lint] 🚀  Start image=catthehacker/ubuntu:act-latest
[Black/lint]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Black/lint]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Black/lint]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[]
[Black/lint]   ☁  git clone 'https://github.com/psf/black' # ref=stable
[Black/lint] ⭐ Run Pre psf/black@stable
[Black/lint]   ✅  Success - Pre psf/black@stable
[Black/lint] ⭐ Run Main actions/checkout@v3
[Black/lint]   🐳  docker cp src=/home/ggoretkin/repos/gh-act-black/. dst=/home/ggoretkin/repos/gh-act-black
[Black/lint]   ✅  Success - Main actions/checkout@v3
[Black/lint] ⭐ Run Main psf/black@stable
[Black/lint]   🐳  docker cp src=/home/ggoretkin/.cache/act/psf-black@stable/ dst=/var/run/act/actions/psf-black@stable/
[Black/lint] ⭐ Run Main if [ "$RUNNER_OS" == "Windows" ]; then
  python $GITHUB_ACTION_PATH/action/main.py
else
  python3 $GITHUB_ACTION_PATH/action/main.py
fi
[Black/lint]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-0.sh] user= workdir=
| The virtual environment was not created successfully because ensurepip is not
| available.  On Debian/Ubuntu systems, you need to install the python3-venv
| package using the following command.
| 
|     apt install python3.10-venv
| 
| You may need to use sudo with that command.  After installing the python3-venv
| package, recreate your virtual environment.
| 
| Failing command: ['/var/run/act/actions/psf-black@stable/.black-env/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']
| 
| Traceback (most recent call last):
|   File "/var/run/act/actions/psf-black@stable/action/main.py", line 16, in <module>
|     run([sys.executable, "-m", "venv", str(ENV_PATH)], check=True)
|   File "/usr/lib/python3.10/subprocess.py", line 524, in run
|     raise CalledProcessError(retcode, process.args,
| subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'venv', '/var/run/act/actions/psf-black@stable/.black-env']' returned non-zero exit status 1.
[Black/lint]   ❌  Failure - Main if [ "$RUNNER_OS" == "Windows" ]; then
  python $GITHUB_ACTION_PATH/action/main.py
else
  python3 $GITHUB_ACTION_PATH/action/main.py
fi
[Black/lint] exitcode '1': failure
[Black/lint]   ❌  Failure - Main psf/black@stable
[Black/lint] exitcode '1': failure
[Black/lint] ⭐ Run Post psf/black@stable
[Black/lint]   🐳  docker cp src=/home/ggoretkin/.cache/act/psf-black@stable/ dst=/var/run/act/actions/psf-black@stable/
[Black/lint]   ✅  Success - Post psf/black@stable
[Black/lint] 🏁  Job failed
Error: Job 'lint' failed

Additional information

No response

Originally created by @ggoretkin-bdai on GitHub (Apr 25, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1765 ### Bug report info ```plain text $ gh act --bug-report act version: 0.2.44 GOOS: linux GOARCH: amd64 NumCPU: 16 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/ggoretkin/.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.18.10 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: 65088b8f28d44da128b95ec194a04277b8856be9 vcs.time: 2023-01-20T18:39:07Z vcs.modified: true Docker Engine: Engine version: 20.10.21 Engine runtime: runc Cgroup version: 2 Cgroup driver: systemd Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu 22.04.2 LTS OS type: linux OS version: 22.04 OS arch: x86_64 OS kernel: 5.19.0-40-generic OS CPU: 16 OS memory: 15699 MB Security options: name=apparmor name=seccomp,profile=default name=cgroupns ``` ``` ### Command used with act ```sh gh act -W .github/workflows/black.yaml ``` ``` ### Describe issue The workflow completes on `github.com`, so I expect it to work the same on my local system. ``` | The virtual environment was not created successfully because ensurepip is not | available. On Debian/Ubuntu systems, you need to install the python3-venv | package using the following command. | | apt install python3.10-venv | | You may need to use sudo with that command. After installing the python3-venv | package, recreate your virtual environment. ``` See also https://github.com/nektos/act/issues/925 ### Link to GitHub repository https://github.com/ggoretkin-bdai/ggoretkin-gh-act-black-local-test ### Workflow content ```yml name: Black on: push: branches: - main pull_request: branches: - main jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: psf/black@stable ``` ``` ### Relevant log output ```sh $ gh act -W .github/workflows/black.yaml [Black/lint] 🚀 Start image=catthehacker/ubuntu:act-latest [Black/lint] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true [Black/lint] 🐳 docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [Black/lint] 🐳 docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] [Black/lint] ☁ git clone 'https://github.com/psf/black' # ref=stable [Black/lint] ⭐ Run Pre psf/black@stable [Black/lint] ✅ Success - Pre psf/black@stable [Black/lint] ⭐ Run Main actions/checkout@v3 [Black/lint] 🐳 docker cp src=/home/ggoretkin/repos/gh-act-black/. dst=/home/ggoretkin/repos/gh-act-black [Black/lint] ✅ Success - Main actions/checkout@v3 [Black/lint] ⭐ Run Main psf/black@stable [Black/lint] 🐳 docker cp src=/home/ggoretkin/.cache/act/psf-black@stable/ dst=/var/run/act/actions/psf-black@stable/ [Black/lint] ⭐ Run Main if [ "$RUNNER_OS" == "Windows" ]; then python $GITHUB_ACTION_PATH/action/main.py else python3 $GITHUB_ACTION_PATH/action/main.py fi [Black/lint] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-0.sh] user= workdir= | The virtual environment was not created successfully because ensurepip is not | available. On Debian/Ubuntu systems, you need to install the python3-venv | package using the following command. | | apt install python3.10-venv | | You may need to use sudo with that command. After installing the python3-venv | package, recreate your virtual environment. | | Failing command: ['/var/run/act/actions/psf-black@stable/.black-env/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip'] | | Traceback (most recent call last): | File "/var/run/act/actions/psf-black@stable/action/main.py", line 16, in <module> | run([sys.executable, "-m", "venv", str(ENV_PATH)], check=True) | File "/usr/lib/python3.10/subprocess.py", line 524, in run | raise CalledProcessError(retcode, process.args, | subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'venv', '/var/run/act/actions/psf-black@stable/.black-env']' returned non-zero exit status 1. [Black/lint] ❌ Failure - Main if [ "$RUNNER_OS" == "Windows" ]; then python $GITHUB_ACTION_PATH/action/main.py else python3 $GITHUB_ACTION_PATH/action/main.py fi [Black/lint] exitcode '1': failure [Black/lint] ❌ Failure - Main psf/black@stable [Black/lint] exitcode '1': failure [Black/lint] ⭐ Run Post psf/black@stable [Black/lint] 🐳 docker cp src=/home/ggoretkin/.cache/act/psf-black@stable/ dst=/var/run/act/actions/psf-black@stable/ [Black/lint] ✅ Success - Post psf/black@stable [Black/lint] 🏁 Job failed Error: Job 'lint' failed ``` ### Additional information _No response_
kerem 2026-03-01 21:46:57 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@ggoretkin-bdai commented on GitHub (Apr 25, 2023):

I will try setting ~/.actrc to

-P ubuntu-latest=catthehacker/ubuntu:full-latest
<!-- gh-comment-id:1521109995 --> @ggoretkin-bdai commented on GitHub (Apr 25, 2023): I will try setting `~/.actrc` to ``` -P ubuntu-latest=catthehacker/ubuntu:full-latest ```
Author
Owner

@ggoretkin-bdai commented on GitHub (Apr 25, 2023):

I will try setting ~/.actrc to

-P ubuntu-latest=catthehacker/ubuntu:full-latest

Using this image fixed the issue.

<!-- gh-comment-id:1521224994 --> @ggoretkin-bdai commented on GitHub (Apr 25, 2023): > I will try setting `~/.actrc` to > > ``` > -P ubuntu-latest=catthehacker/ubuntu:full-latest > ``` Using this image fixed the issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#860
No description provided.