Bug: Failed to install python packages: a bytes-like object is required, not 'str'
Describe the bug
Tried to run docker-compose run archivebox init --setup and got Failed to install python packages: a bytes-like object is required, not 'str'.
[+] Installing enabled ArchiveBox dependencies automatically...
Installing YOUTUBEDL_BINARY automatically using pip...
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: youtube_dl in /usr/local/lib/python3.10/site-packages (2021.12.17)
WARNING: You are using pip version 22.0.4; however, version 22.2.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
[X] Failed to install python packages: a bytes-like object is required, not 'str'
ERROR: 1
Steps to reproduce
- Used the following
docker-compose.yml.
services:
archivebox:
image: archivebox/archivebox
container_name: archivebox
restart: always
command: server --quick-init 0.0.0.0:8000
env_file:
- archivebox.env
volumes:
- archivebox-data:/data
networks:
- traefik2-network
labels:
- "traefik.enable=true"
## HTTP Routers
- "traefik.http.routers.archivebox-rtr.entrypoints=https"
- "traefik.http.routers.archivebox-rtr.rule=Host(`ab.$CLOUDFLARE_DOMAINNAME`)"
- "traefik.http.routers.archivebox-rtr.tls=true"
## Middlewares
- "traefik.http.routers.archivebox-rtr.middlewares=no-auth-chain@file"
## HTTP Services
- "traefik.http.routers.archivebox-rtr.service=archivebox-svc"
- "traefik.http.services.archivebox-svc.loadbalancer.server.port=8000"
volumes:
archivebox-data:
driver: local-persist
driver_opts:
mountpoint: ${DOCKER_VOLUMES}/archivebox
networks:
traefik2-network:
external: true
Content of archivebox.env:
SUBMIT_ARCHIVE_DOT_ORG=False
OUTPUT_PERMISSIONS=755
ONLY_NEW=False
TIMEOUT=120
SAVE_TITLE=True
SAVE_FAVICON=True
SAVE_WGET=False
SAVE_WARC=False
SAVE_PDF=True
SAVE_SCREENSHOT=False
SAVE_DOM=False
SAVE_SINGLEFILE=True
SAVE_READABILITY=True
SAVE_MERCURY=False
SAVE_GIT=False
SAVE_MEDIA=False
SAVE_ARCHIVE_DOT_ORG=False
USE_COLOR=True
PUBLIC_INDEX=False
PUBLIC_SNAPSHOTS=False
PUBLIC_ADD_VIEW=False
TIME_ZONE=Europe/Brussels
- Run
docker-compose run archivebox init --setup. - Got the following output:
[+] Installing enabled ArchiveBox dependencies automatically...
Installing YOUTUBEDL_BINARY automatically using pip...
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: youtube_dl in /usr/local/lib/python3.10/site-packages (2021.12.17)
WARNING: You are using pip version 22.0.4; however, version 22.2.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
[X] Failed to install python packages: a bytes-like object is required, not 'str'
ERROR: 1
Screenshots or log output
[+] Installing enabled ArchiveBox dependencies automatically...
Installing YOUTUBEDL_BINARY automatically using pip...
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: youtube_dl in /usr/local/lib/python3.10/site-packages (2021.12.17)
WARNING: You are using pip version 22.0.4; however, version 22.2.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
[X] Failed to install python packages: a bytes-like object is required, not 'str'
ERROR: 1
ArchiveBox version
ArchiveBox v0.6.3
Cpython Linux Linux-5.10.0-15-amd64-x86_64-with-glibc2.31 x86_64
IN_DOCKER=True DEBUG=False IS_TTY=True TZ=UTC SEARCH_BACKEND_ENGINE=ripgrep
[i] Dependency versions:
√ ARCHIVEBOX_BINARY v0.6.3 valid /usr/local/bin/archivebox
√ PYTHON_BINARY v3.10.4 valid /usr/local/bin/python3.10
√ DJANGO_BINARY v3.1.14 valid /usr/local/lib/python3.10/site-packages/django/bin/django-admin.py
√ CURL_BINARY v7.74.0 valid /usr/bin/curl
- WGET_BINARY - disabled /usr/bin/wget
√ NODE_BINARY v17.9.0 valid /usr/bin/node
√ SINGLEFILE_BINARY v0.3.16 valid /node/node_modules/single-file/cli/single-file
√ READABILITY_BINARY v0.0.2 valid /node/node_modules/readability-extractor/readability-extractor
- MERCURY_BINARY - disabled /node/node_modules/@postlight/mercury-parser/cli.js
- GIT_BINARY - disabled /usr/bin/git
- YOUTUBEDL_BINARY - disabled /usr/local/bin/yt-dlp
√ CHROME_BINARY v101.0.4951.41 valid /usr/bin/chromium
√ RIPGREP_BINARY v12.1.1 valid /usr/bin/rg
[i] Source-code locations:
√ PACKAGE_DIR 24 files valid /app/archivebox
√ TEMPLATES_DIR 4 files valid /app/archivebox/templates
- CUSTOM_TEMPLATES_DIR - disabled
[i] Secrets locations:
- CHROME_USER_DATA_DIR - disabled
- COOKIES_FILE - disabled
[i] Data locations:
√ OUTPUT_DIR 5 files valid /data
√ SOURCES_DIR 0 files valid ./sources
√ LOGS_DIR 1 files valid ./logs
√ ARCHIVE_DIR 0 files valid ./archive
√ CONFIG_FILE 81.0 Bytes valid ./ArchiveBox.conf
√ SQL_INDEX 204.0 KB valid ./index.sqlite3
In docker you don't need to run --setup, docker-compose run archivebox init is enough.
Thanks. Maybe the readme.md file shoud be fiexed.

I'm actually going to re-open this because this issue shouldn't happen even in docker, it's a sign that there's a b'...' or missing .decode() somewhere.
Hey, just following up on this issue. Is this still a problem or has the issue been resolved?
Should be resolved 👍