Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install python3-distutils on ubuntu 24.04 [closed]

I'm attempting to install python3-distutils on Ubuntu 24.04 using the command sudo apt-get install python3-distutils, but encountering an error. Could someone please provide an alternative method to download and install python3-distutils?

root@vps:~# apt-get 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

In my attempt to install python3-distutils on Ubuntu 24.04, I used the command sudo apt-get install python3-distutils. I expected this command to successfully install the python3-distutils package without any errors. However, I encountered an error indicating that the package could not be found, which led me to seek alternative methods for downloading and installing python3-distutils

like image 930
Shivang Kareliya Avatar asked Feb 26 '26 08:02

Shivang Kareliya


1 Answers

distutils has been deprecated in Python 3.12, the version Ubuntu 24.04 is using, see PEP 632 for details.

As suggested in the documentation, you can use setuptools as an enhanced alternative.

The recommended pip installer runs all setup.py scripts with setuptools, even if the script itself only imports distutils.

That means,

$ pip install setuptools
like image 146
PilgrimLyieu Avatar answered Mar 01 '26 12:03

PilgrimLyieu