[GH-ISSUE #1686] Bug: Python 3.13 compatibility #2517

Closed
opened 2026-03-01 17:59:34 +03:00 by kerem · 7 comments
Owner

Originally created by @OlehAhieienko on GitHub (Jul 10, 2025).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1686

Originally assigned to: @pirate on GitHub.

Provide a screenshot and describe the bug

Archivebox does not work with Python 3.13 due to removed cgi module
https://docs.python.org/3/library/cgi.html

Steps to reproduce

1. Create new Python 3.13 venv
2. Install `archivebox` with pip
3. Install dependencies (`playwright`, `chromium`, `nodejs` etc)
4. Run `archivebox init --setup`

Logs or errors

$ archivebox init --setup
[i] [2025-07-10 08:17:06] ArchiveBox v0.7.1: archivebox init --setup
    > /opt/archivebox/data

Traceback (most recent call last):
  File "/opt/archivebox/venv/bin/archivebox", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/opt/archivebox/venv/lib/python3.13/site-packages/archivebox/cli/__init__.py", line 140, in main
    run_subcommand(
    ~~~~~~~~~~~~~~^
        subcommand=command.subcommand,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        pwd=pwd or OUTPUT_DIR,
        ^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/archivebox/venv/lib/python3.13/site-packages/archivebox/cli/__init__.py", line 74, in run_subcommand
    setup_django(in_memory_db=subcommand in fake_db, check_db=cmd_requires_db and not init_pending)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/archivebox/venv/lib/python3.13/site-packages/archivebox/config.py", line 1261, in setup_django
    django.setup()
    ~~~~~~~~~~~~^^
  File "/opt/archivebox/venv/lib/python3.13/site-packages/django/__init__.py", line 16, in setup
    from django.urls import set_script_prefix
  File "/opt/archivebox/venv/lib/python3.13/site-packages/django/urls/__init__.py", line 1, in <module>
    from .base import (
    ...<3 lines>...
    )
  File "/opt/archivebox/venv/lib/python3.13/site-packages/django/urls/base.py", line 9, in <module>
    from .exceptions import NoReverseMatch, Resolver404
  File "/opt/archivebox/venv/lib/python3.13/site-packages/django/urls/exceptions.py", line 1, in <module>
    from django.http import Http404
  File "/opt/archivebox/venv/lib/python3.13/site-packages/django/http/__init__.py", line 2, in <module>
    from django.http.request import (
        HttpRequest, QueryDict, RawPostDataException, UnreadablePostError,
    )
  File "/opt/archivebox/venv/lib/python3.13/site-packages/django/http/request.py", line 1, in <module>
    import cgi
ModuleNotFoundError: No module named 'cgi'

ArchiveBox Version

0.7.1
ArchiveBox v0.7.1 Cpython Linux Linux-6.12.34+rpt-rpi-v8-aarch64-with-glibc2.41 aarch64
DEBUG=False IN_DOCKER=False IN_QEMU=False IS_TTY=True TZ=UTC FS_ATOMIC=True FS_REMOTE=False FS_USER=992:986 FS_PERMS=644 SEARCH_BACKEND=ripgrep

[i] Dependency versions:
 √  PYTHON_BINARY         v3.13.3         valid     /usr/bin/python3.13                                                         
 √  SQLITE_BINARY         v2.6.0          valid     /usr/lib/python3.13/sqlite3/dbapi2.py                                       
 √  DJANGO_BINARY         v3.1.14         valid     /opt/archivebox/venv/lib/python3.13/site-packages/django/__init__.py        
 √  ARCHIVEBOX_BINARY     v0.7.1          valid     /opt/archivebox/venv/bin/archivebox                                         

 √  CURL_BINARY           v8.14.1         valid     /usr/bin/curl                                                               
 √  WGET_BINARY           v1.25.0         valid     /usr/bin/wget                                                               
 √  NODE_BINARY           v20.19.2        valid     /usr/bin/node                                                               
 X  SINGLEFILE_BINARY     ?               invalid   single-file                                                                 
 X  READABILITY_BINARY    ?               invalid   readability-extractor                                                       
 X  MERCURY_BINARY        ?               invalid   postlight-parser                                                            
 √  GIT_BINARY            v2.47.2         valid     /usr/bin/git                                                                
 √  YOUTUBEDL_BINARY      v2025.06.30     valid     /opt/archivebox/venv/bin/yt-dlp                                             
 √  CHROME_BINARY         v138.0.7204.92  valid     /usr/bin/chromium                                                           
 X  RIPGREP_BINARY        ?               invalid   rg                                                                          

[i] Source-code locations:
 √  PACKAGE_DIR           24 files        valid     /opt/archivebox/venv/lib/python3.13/site-packages/archivebox                
 √  TEMPLATES_DIR         4 files         valid     /opt/archivebox/venv/lib/python3.13/site-packages/archivebox/templates      
 -  CUSTOM_TEMPLATES_DIR  -               disabled  None                                                                        

[i] Secrets locations:
 -  CHROME_USER_DATA_DIR  -               disabled  None                                                                        
 -  COOKIES_FILE          -               disabled  None                                                                        


[i] Data locations:

[!] Warning: Missing 4 recommended dependencies
    ! SINGLEFILE_BINARY: single-file (unable to detect version)
      Hint: To install all packages automatically run: archivebox setup
            or to disable it and silence this warning: archivebox config --set SAVE_SINGLEFILE=False
            
    ! READABILITY_BINARY: readability-extractor (unable to detect version)
      Hint: To install all packages automatically run: archivebox setup
            or to disable it and silence this warning: archivebox config --set SAVE_READABILITY=False
            
    ! MERCURY_BINARY: postlight-parser (unable to detect version)
      Hint: To install all packages automatically run: archivebox setup
            or to disable it and silence this warning: archivebox config --set SAVE_MERCURY=False
            
    ! RIPGREP_BINARY: rg (unable to detect version)

How did you install the version of ArchiveBox you are using?

pip

What operating system are you running on?

Debian Trixie ARM64

What type of drive are you using to store your ArchiveBox data?

  • some of data/ is on a local SSD or NVMe drive
  • some of data/ is on a spinning hard drive or external USB drive
  • some of data/ is on a network mount (e.g. NFS/SMB/Ceph/GlusterFS/etc.)
  • some of data/ is on a FUSE mount (e.g. SSHFS/RClone/S3/B2/Google Drive/Dropbox/etc.)

Docker Compose Configuration


ArchiveBox Configuration


Originally created by @OlehAhieienko on GitHub (Jul 10, 2025). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1686 Originally assigned to: @pirate on GitHub. ### Provide a screenshot and describe the bug Archivebox does not work with Python 3.13 due to removed `cgi` module https://docs.python.org/3/library/cgi.html ### Steps to reproduce ```markdown 1. Create new Python 3.13 venv 2. Install `archivebox` with pip 3. Install dependencies (`playwright`, `chromium`, `nodejs` etc) 4. Run `archivebox init --setup` ``` ### Logs or errors ```shell $ archivebox init --setup [i] [2025-07-10 08:17:06] ArchiveBox v0.7.1: archivebox init --setup > /opt/archivebox/data Traceback (most recent call last): File "/opt/archivebox/venv/bin/archivebox", line 8, in <module> sys.exit(main()) ~~~~^^ File "/opt/archivebox/venv/lib/python3.13/site-packages/archivebox/cli/__init__.py", line 140, in main run_subcommand( ~~~~~~~~~~~~~~^ subcommand=command.subcommand, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...<2 lines>... pwd=pwd or OUTPUT_DIR, ^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/opt/archivebox/venv/lib/python3.13/site-packages/archivebox/cli/__init__.py", line 74, in run_subcommand setup_django(in_memory_db=subcommand in fake_db, check_db=cmd_requires_db and not init_pending) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/archivebox/venv/lib/python3.13/site-packages/archivebox/config.py", line 1261, in setup_django django.setup() ~~~~~~~~~~~~^^ File "/opt/archivebox/venv/lib/python3.13/site-packages/django/__init__.py", line 16, in setup from django.urls import set_script_prefix File "/opt/archivebox/venv/lib/python3.13/site-packages/django/urls/__init__.py", line 1, in <module> from .base import ( ...<3 lines>... ) File "/opt/archivebox/venv/lib/python3.13/site-packages/django/urls/base.py", line 9, in <module> from .exceptions import NoReverseMatch, Resolver404 File "/opt/archivebox/venv/lib/python3.13/site-packages/django/urls/exceptions.py", line 1, in <module> from django.http import Http404 File "/opt/archivebox/venv/lib/python3.13/site-packages/django/http/__init__.py", line 2, in <module> from django.http.request import ( HttpRequest, QueryDict, RawPostDataException, UnreadablePostError, ) File "/opt/archivebox/venv/lib/python3.13/site-packages/django/http/request.py", line 1, in <module> import cgi ModuleNotFoundError: No module named 'cgi' ``` ### ArchiveBox Version ```shell 0.7.1 ArchiveBox v0.7.1 Cpython Linux Linux-6.12.34+rpt-rpi-v8-aarch64-with-glibc2.41 aarch64 DEBUG=False IN_DOCKER=False IN_QEMU=False IS_TTY=True TZ=UTC FS_ATOMIC=True FS_REMOTE=False FS_USER=992:986 FS_PERMS=644 SEARCH_BACKEND=ripgrep [i] Dependency versions: √ PYTHON_BINARY v3.13.3 valid /usr/bin/python3.13 √ SQLITE_BINARY v2.6.0 valid /usr/lib/python3.13/sqlite3/dbapi2.py √ DJANGO_BINARY v3.1.14 valid /opt/archivebox/venv/lib/python3.13/site-packages/django/__init__.py √ ARCHIVEBOX_BINARY v0.7.1 valid /opt/archivebox/venv/bin/archivebox √ CURL_BINARY v8.14.1 valid /usr/bin/curl √ WGET_BINARY v1.25.0 valid /usr/bin/wget √ NODE_BINARY v20.19.2 valid /usr/bin/node X SINGLEFILE_BINARY ? invalid single-file X READABILITY_BINARY ? invalid readability-extractor X MERCURY_BINARY ? invalid postlight-parser √ GIT_BINARY v2.47.2 valid /usr/bin/git √ YOUTUBEDL_BINARY v2025.06.30 valid /opt/archivebox/venv/bin/yt-dlp √ CHROME_BINARY v138.0.7204.92 valid /usr/bin/chromium X RIPGREP_BINARY ? invalid rg [i] Source-code locations: √ PACKAGE_DIR 24 files valid /opt/archivebox/venv/lib/python3.13/site-packages/archivebox √ TEMPLATES_DIR 4 files valid /opt/archivebox/venv/lib/python3.13/site-packages/archivebox/templates - CUSTOM_TEMPLATES_DIR - disabled None [i] Secrets locations: - CHROME_USER_DATA_DIR - disabled None - COOKIES_FILE - disabled None [i] Data locations: [!] Warning: Missing 4 recommended dependencies ! SINGLEFILE_BINARY: single-file (unable to detect version) Hint: To install all packages automatically run: archivebox setup or to disable it and silence this warning: archivebox config --set SAVE_SINGLEFILE=False ! READABILITY_BINARY: readability-extractor (unable to detect version) Hint: To install all packages automatically run: archivebox setup or to disable it and silence this warning: archivebox config --set SAVE_READABILITY=False ! MERCURY_BINARY: postlight-parser (unable to detect version) Hint: To install all packages automatically run: archivebox setup or to disable it and silence this warning: archivebox config --set SAVE_MERCURY=False ! RIPGREP_BINARY: rg (unable to detect version) ``` ### How did you install the version of ArchiveBox you are using? pip ### What operating system are you running on? Debian Trixie ARM64 ### What type of drive are you using to store your ArchiveBox data? - [ ] some of `data/` is on a local SSD or NVMe drive - [ ] some of `data/` is on a spinning hard drive or external USB drive - [ ] some of `data/` is on a network mount (e.g. NFS/SMB/Ceph/GlusterFS/etc.) - [ ] some of `data/` is on a FUSE mount (e.g. SSHFS/RClone/S3/B2/Google Drive/Dropbox/etc.) ### Docker Compose Configuration ```shell ``` ### ArchiveBox Configuration ```shell ```
kerem closed this issue 2026-03-01 17:59:34 +03:00
Author
Owner

@pirate commented on GitHub (Jul 10, 2025):

seems like the django version we use doesn't support 3.13

<!-- gh-comment-id:3056614990 --> @pirate commented on GitHub (Jul 10, 2025): seems like the django version we use doesn't support 3.13
Author
Owner

@OlehAhieienko commented on GitHub (Jul 10, 2025):

seems like the django version we use doesn't support 3.13

Any plans on migrating to newer versions?

<!-- gh-comment-id:3057817954 --> @OlehAhieienko commented on GitHub (Jul 10, 2025): > seems like the django version we use doesn't support 3.13 Any plans on migrating to newer versions?
Author
Owner

@pirate commented on GitHub (Jul 10, 2025):

eventually sure but probably not soon, see this comment: https://github.com/ArchiveBox/ArchiveBox/issues/191#issuecomment-2848370416

<!-- gh-comment-id:3058985183 --> @pirate commented on GitHub (Jul 10, 2025): eventually sure but probably not soon, see this comment: https://github.com/ArchiveBox/ArchiveBox/issues/191#issuecomment-2848370416
Author
Owner

@virtadpt commented on GitHub (Jul 11, 2025):

You can also use pip to install the legacy-cgi module and it'll work. That's what I did.

<!-- gh-comment-id:3060364085 --> @virtadpt commented on GitHub (Jul 11, 2025): You can also use pip to install the legacy-cgi module and it'll work. That's what I did.
Author
Owner

@farooqkz commented on GitHub (Sep 4, 2025):

You can also use pip to install the legacy-cgi module and it'll work. That's what I did.

Thanks very helpful

<!-- gh-comment-id:3253526219 --> @farooqkz commented on GitHub (Sep 4, 2025): > You can also use pip to install the legacy-cgi module and it'll work. That's what I did. Thanks very helpful
Author
Owner

@deutrino commented on GitHub (Oct 28, 2025):

you may also need to replace /usr/local/lib/python3.13/dist-packages/django/utils with the version here

<!-- gh-comment-id:3454392465 --> @deutrino commented on GitHub (Oct 28, 2025): you may also need to replace `/usr/local/lib/python3.13/dist-packages/django/utils` with the version [here](https://raw.githubusercontent.com/django/django/b8c9e9fae14676d2e81242cb8df1e2eeef9c3a2d/django/utils/version.py)
Author
Owner

@pirate commented on GitHub (Dec 29, 2025):

fixed on dev, we now support only 3.13 and above, defaulting to 3.14 if available

<!-- gh-comment-id:3697595662 --> @pirate commented on GitHub (Dec 29, 2025): fixed on `dev`, we now support only 3.13 and above, defaulting to 3.14 if available
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/ArchiveBox#2517
No description provided.