Skip to content

Comments

Make distutils optional#646

Closed
abraemer wants to merge 1 commit intowhipper-team:developfrom
abraemer:develop
Closed

Make distutils optional#646
abraemer wants to merge 1 commit intowhipper-team:developfrom
abraemer:develop

Conversation

@abraemer
Copy link

@abraemer abraemer commented May 3, 2025

As #611 states, distutils has been removed from Python 3.12 onwards. This means that the current release of whipper does not run on Ubuntu 24.04 (current LTS). This PR provides a very minimal fix for this by:

  • moving the import of distutils to where it is required
  • also catching ModuleNotFoundErrors occuring from 3.12 onwards

I know this is not a perfect fix by any means. However, it is sufficient for me to successfully use whipper and I could find it in 3mins of looking. I really don't know anything about whipper and not much about distutils or how to replace its deprecated functionality properly.

Partially resolves #611

Anyone else who stumbles upon this: If you don't run whipper in a virtualenv (e.g. if you installed it via apt), it is enough to just delete the import at the top of the file. Just edit the last file mentioned in the error message (at /usr/lib/python3/dist-packages/whipper/command/main.py for me) and delete the line from distutils.sysconfig import get_python_lib (around line 10).

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💖 Thanks for opening your first pull request here! 💖

* move the import of distutils to where it is required
* also catches ModuleNotFoundErrors occuring from 3.12 onwards

Signed-off-by: Adrian Braemer <bradrian@gmail.com>
@mweinelt
Copy link
Contributor

Bummer plugins where integrated that way. Entrypoints in setuptools are a slightly nicer way to accomplish that.

https://setuptools.pypa.io/en/latest/userguide/entry_point.html#entry-points-for-plugins

@MerlijnWajer
Copy link
Collaborator

I think this has been solved by adab259, let's make sure that the plugins still work though. And if not, we can fix that before the release.

@MerlijnWajer
Copy link
Collaborator

I think this should work in latest develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

distutils has been deprecated in Python 3.12

3 participants