[GH-ISSUE #1616] Bug: Bare metal install not possible on Ubuntu 24.10 - python3-distutils has been deprecated #3982

Closed
opened 2026-03-15 01:11:09 +03:00 by kerem · 8 comments
Owner

Originally created by @nextgenthemes on GitHub (Dec 11, 2024).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1616

Originally assigned to: @pirate on GitHub.

Provide a screenshot and describe the bug

python3-distutils has been deprecated.

Btw, I think the pip install should be done in a python virtualenv. I think new versions of Ubuntu/Python do not even let you do it without one. At least they encourage and complain if you try otherwise, not sure.

Also, you tell people to install 3 packages with pip in the docs

`pip install --upgrade --ignore-installed archivebox[ldap,sonic]

That is not a valid command. And also ldap and sonic are not valid pip package names. So I guess you want people to have the latest versions of them.

I think I should read like this:

# this should be un dependancy install command under 1. in the docs
sudo apt install python3-venv

# Create venv for archivebox and cd into it
python3 -m venv archivebox-venv
cd archivebox-venv

# Install archivebox (still inside archivebox-venv) thease are the actual package names
./bin/pip3 install --upgrade --ignore-installed python-sonic
./bin/pip3 install --upgrade --ignore-installed python3-ldab
./bin/pip3 install --upgrade --ignore-installed archivebox

# symlink the venv version into $PATH
ln -s $(readlink -m "./bin/archivebox") ~/bin/archivebox

I have archivebox as a command now like this globally, but it's giving errors that end with ModuleNotFoundError: No module named 'distutils'. I expected it to fail because the package python3-distutils was never installed.

Steps to reproduce

I described that above.

Logs or errors

archivebox init                                      
Traceback (most recent call last):
  File "/home/user23/bin/archivebox", line 5, in <module>
    from archivebox.cli import main
  File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/archivebox/cli/__init__.py", line 11, in <module>
    from ..config import OUTPUT_DIR, check_data_folder, check_migrations
  File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/archivebox/config.py", line 33, in <module>
    import django
  File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/django/__init__.py", line 1, in <module>
    from django.utils.version import get_version
  File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/django/utils/version.py", line 6, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

ArchiveBox Version

Ubuntu 24.10
Python 3.12.7

Well, the version command fails as well. Here is the full output, same as with init.


archivebox version                                      
Traceback (most recent call last):
  File "/home/user23/bin/archivebox", line 5, in <module>
    from archivebox.cli import main
  File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/archivebox/cli/__init__.py", line 11, in <module>
    from ..config import OUTPUT_DIR, check_data_folder, check_migrations
  File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/archivebox/config.py", line 33, in <module>
    import django
  File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/django/__init__.py", line 1, in <module>
    from django.utils.version import get_version
  File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/django/utils/version.py", line 6, in <module>
    from distutils.version import LooseVersion
ModuleNotFoundError: No module named 'distutils'

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

pip

What operating system are you running on?

Linux (Ubuntu/Debian/Arch/Alpine/etc.)

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

  • data/ is on a local SSD or NVMe drive
  • data/ is on a spinning hard drive or external USB drive
  • data/ is on a network mount (e.g. NFS/SMB/CIFS/etc.)
  • data/ is on a FUSE mount (e.g. SSHFS/RClone/S3/B2/OneDrive, etc.)

Docker Compose Configuration


ArchiveBox Configuration

Nothing yet.
Originally created by @nextgenthemes on GitHub (Dec 11, 2024). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/1616 Originally assigned to: @pirate on GitHub. ### Provide a screenshot and describe the bug `python3-distutils` has been deprecated. Btw, I think the pip install should be done in a python virtualenv. I think new versions of Ubuntu/Python do not even let you do it without one. At least they encourage and complain if you try otherwise, not sure. Also, you tell people to install 3 packages with pip in the docs ``` `pip install --upgrade --ignore-installed archivebox[ldap,sonic] ``` That is not a valid command. And also ldap and sonic are not valid pip package names. So I guess you want people to have the latest versions of them. I think I should read like this: ``` # this should be un dependancy install command under 1. in the docs sudo apt install python3-venv # Create venv for archivebox and cd into it python3 -m venv archivebox-venv cd archivebox-venv # Install archivebox (still inside archivebox-venv) thease are the actual package names ./bin/pip3 install --upgrade --ignore-installed python-sonic ./bin/pip3 install --upgrade --ignore-installed python3-ldab ./bin/pip3 install --upgrade --ignore-installed archivebox # symlink the venv version into $PATH ln -s $(readlink -m "./bin/archivebox") ~/bin/archivebox ``` I have `archivebox` as a command now like this globally, but it's giving errors that end with `ModuleNotFoundError: No module named 'distutils'`. I expected it to fail because the package `python3-distutils` was never installed. ### Steps to reproduce ```markdown I described that above. ``` ### Logs or errors ```shell archivebox init Traceback (most recent call last): File "/home/user23/bin/archivebox", line 5, in <module> from archivebox.cli import main File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/archivebox/cli/__init__.py", line 11, in <module> from ..config import OUTPUT_DIR, check_data_folder, check_migrations File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/archivebox/config.py", line 33, in <module> import django File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/django/__init__.py", line 1, in <module> from django.utils.version import get_version File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/django/utils/version.py", line 6, in <module> from distutils.version import LooseVersion ModuleNotFoundError: No module named 'distutils' ``` ### ArchiveBox Version ```shell Ubuntu 24.10 Python 3.12.7 Well, the version command fails as well. Here is the full output, same as with init. archivebox version Traceback (most recent call last): File "/home/user23/bin/archivebox", line 5, in <module> from archivebox.cli import main File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/archivebox/cli/__init__.py", line 11, in <module> from ..config import OUTPUT_DIR, check_data_folder, check_migrations File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/archivebox/config.py", line 33, in <module> import django File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/django/__init__.py", line 1, in <module> from django.utils.version import get_version File "/home/user23/Progs/archivebox/archivebox-venv/lib/python3.12/site-packages/django/utils/version.py", line 6, in <module> from distutils.version import LooseVersion ModuleNotFoundError: No module named 'distutils' ``` ### How did you install the version of ArchiveBox you are using? pip ### What operating system are you running on? Linux (Ubuntu/Debian/Arch/Alpine/etc.) ### What type of drive are you using to store your ArchiveBox data? - [x] `data/` is on a local SSD or NVMe drive - [ ] `data/` is on a spinning hard drive or external USB drive - [ ] `data/` is on a network mount (e.g. NFS/SMB/CIFS/etc.) - [ ] `data/` is on a FUSE mount (e.g. SSHFS/RClone/S3/B2/OneDrive, etc.) ### Docker Compose Configuration ```shell ``` ### ArchiveBox Configuration ```shell Nothing yet. ```
kerem closed this issue 2026-03-15 01:11:15 +03:00
Author
Owner

@pirate commented on GitHub (Dec 11, 2024):

  • python3-distutils is not deprecated universally, iirc it was only created recently for the 3.11 systems that removed it from the stdlib, with plans to deprecate it gradually in 3.12. https://packages.debian.org/search?keywords=python3-distutils

    • on the newest debian systems with python 3.12: apt install python3-distutils or pip install setuptools depending on Linux flavor
    • on some slightly older debian-based systems / Ubuntu with 3.11 & 3.12: pip install distutils
    • on most older systems: it's not needed because python <= 3.11 came with distutils included
  • the pip install should be done in a python virtualenv, yes, always, I expect everyone to install python packages in either a venv, pipx, conda, uv, poetry, etc. environment, that's been true for many years at this point. there are some environments where it's not necessary (e.g. single-purpose systems, docker containers, VMs, etc.), it's up to the user to decide where they want to install it, pip install ... in the docs is always a generic stand-in for "install this however you normally install PyPI packages"

  • That is not a valid command. And also ldap and sonic are not valid pip package names., it's a perfectly valid command, packagename[group1,group2] is how you specify pip packges with named groups of optional dependencies. Archivebox provides both an ldap and sonic group. You can learn more about this standard pip syntax here:

<!-- gh-comment-id:2537311890 --> @pirate commented on GitHub (Dec 11, 2024): - `python3-distutils` is not deprecated universally, iirc it was only created recently for the 3.11 systems that removed it from the stdlib, with plans to deprecate it gradually in 3.12. https://packages.debian.org/search?keywords=python3-distutils - on the newest debian systems with python 3.12: `apt install python3-distutils` or `pip install setuptools` depending on Linux flavor - on some slightly older debian-based systems / Ubuntu with 3.11 & 3.12: `pip install distutils` - on most older systems: it's not needed because python <= 3.11 came with `distutils` included - `the pip install should be done in a python virtualenv`, yes, always, I expect everyone to install python packages in either a venv, `pipx`, conda, uv, poetry, etc. environment, that's been true for many years at this point. there are some environments where it's not necessary (e.g. single-purpose systems, docker containers, VMs, etc.), it's up to the user to decide where they want to install it, `pip install ...` in the docs is always a generic stand-in for "install this however you normally install PyPI packages" - `That is not a valid command. And also ldap and sonic are not valid pip package names.`, it's a perfectly valid command, `packagename[group1,group2]` is how you specify pip packges with named groups of optional dependencies. Archivebox provides both an `ldap` and `sonic` group. You can learn more about this standard `pip` syntax here: - https://peps.python.org/pep-0735/ - https://www.pyopensci.org/python-package-guide/package-structure-code/declare-dependencies.html#create-optional-dependency-groups - https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#dependencies-optional-dependencies
Author
Owner

@0duck0 commented on GitHub (Dec 13, 2024):

Python Version: 3.12

Report details

  • Date generated: 2024-12-13 13:16:02

Hardware Information:

  • Hardware Model: VMware, Inc. VMware Virtual Platform
  • Memory: 88.7 GiB
  • Processor: AMD Ryzen™ Threadripper™ PRO 3975WXs × 32
  • Graphics: SVGA3D; build: RELEASE; LLVM;
  • Disk Capacity: 536.9 GB

Software Information:

  • Firmware Version: 6.00
  • OS Name: Ubuntu 24.04.1 LTS
  • OS Build: (null)
  • OS Type: 64-bit
  • GNOME Version: 46
  • Windowing System: X11
  • Kernel Version: Linux 6.8.0-50-generic

Command issued: sudo apt install python3-distutils
ERROR MESSAGE:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python3-distutils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-distutils' has no installation candidate

<!-- gh-comment-id:2541999344 --> @0duck0 commented on GitHub (Dec 13, 2024): Python Version: 3.12 ## Report details - **Date generated:** 2024-12-13 13:16:02 ## Hardware Information: - **Hardware Model:** VMware, Inc. VMware Virtual Platform - **Memory:** 88.7 GiB - **Processor:** AMD Ryzen™ Threadripper™ PRO 3975WXs × 32 - **Graphics:** SVGA3D; build: RELEASE; LLVM; - **Disk Capacity:** 536.9 GB ## Software Information: - **Firmware Version:** 6.00 - **OS Name:** Ubuntu 24.04.1 LTS - **OS Build:** (null) - **OS Type:** 64-bit - **GNOME Version:** 46 - **Windowing System:** X11 - **Kernel Version:** Linux 6.8.0-50-generic Command issued: sudo apt install python3-distutils ERROR MESSAGE: Reading package lists... Done Building dependency tree... Done Reading state information... Done Package python3-distutils is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'python3-distutils' has no installation candidate
Author
Owner

@pirate commented on GitHub (Dec 13, 2024):

pip install distutils

<!-- gh-comment-id:2542075300 --> @pirate commented on GitHub (Dec 13, 2024): > `pip install distutils`
Author
Owner

@Mela commented on GitHub (Dec 14, 2024):

Distro: Linux Mint 22 Wilma base: Ubuntu 24.04 noble

uname -a
Linux Lenticular 6.8.0-50-generic #51-Ubuntu SMP PREEMPT_DYNAMIC Sat Nov  9 17:58:29 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
mela@Lenticular:~$ sudo apt install python3-distutils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python3-distutils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-distutils' has no installation candidate
(.venv) archie@Lenticular:~/Archivebox/data$ pip install distutils
ERROR: Could not find a version that satisfies the requirement distutils (from versions: none)
ERROR: No matching distribution found for distutils
<!-- gh-comment-id:2542741130 --> @Mela commented on GitHub (Dec 14, 2024): Distro: Linux Mint 22 Wilma base: Ubuntu 24.04 noble ```bash uname -a Linux Lenticular 6.8.0-50-generic #51-Ubuntu SMP PREEMPT_DYNAMIC Sat Nov 9 17:58:29 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux ``` ```bash mela@Lenticular:~$ sudo apt install python3-distutils Reading package lists... Done Building dependency tree... Done Reading state information... Done Package python3-distutils is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'python3-distutils' has no installation candidate ``` ```bash (.venv) archie@Lenticular:~/Archivebox/data$ pip install distutils ERROR: Could not find a version that satisfies the requirement distutils (from versions: none) ERROR: No matching distribution found for distutils ```
Author
Owner

@Mela commented on GitHub (Dec 14, 2024):

(Temporary?) Solution:

pip install setuptools

<!-- gh-comment-id:2542771944 --> @Mela commented on GitHub (Dec 14, 2024): (Temporary?) Solution: `pip install setuptools `
Author
Owner

@pirate commented on GitHub (Dec 14, 2024):

Ok then you're on one of the really new systems that removed it completely, I thought they were going to offer it as an apt package for a least a couple years but I guess not. In that case you want pip install setuptools or apt install python3-distutils-extra.

What a mess. Seems unlike the Ubuntu/Debian ethos to remove a core library that would break django and many other big common packages without providing patches for them?

<!-- gh-comment-id:2542772017 --> @pirate commented on GitHub (Dec 14, 2024): Ok then you're on one of the really new systems that removed it completely, I thought they were going to offer it as an apt package for a least a couple years but I guess not. In that case you want `pip install setuptools` or `apt install python3-distutils-extra`. What a mess. Seems unlike the Ubuntu/Debian ethos to remove a core library that would break django and many other big common packages without providing patches for them?
Author
Owner

@Mela commented on GitHub (Dec 14, 2024):

What I got from superficial reading while searching for a solution, was: "something, something Ubuntu pushing hard for user using only secure environments ... something ..."

<!-- gh-comment-id:2542801525 --> @Mela commented on GitHub (Dec 14, 2024): What I got from superficial reading while searching for a solution, was: "something, something Ubuntu pushing hard for user using only secure environments ... something ..."
Author
Owner

@pirate commented on GitHub (Dec 18, 2024):

b3edf1f

<!-- gh-comment-id:2550461429 --> @pirate commented on GitHub (Dec 18, 2024): [b3edf1f](https://github.com/ArchiveBox/docs/commit/b3edf1f911c98ad98e06bf0a8ea91da92392e2b4)
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#3982
No description provided.