Claude Mutela
Claude Mutela

Reputation: 1

distutils deprecation warning on ubuntu 22.04

I am deploying openstack using devstack but while deploying I encountered the following error:

Error on exit /opt/stack/devstack/tools/worlddump.py:22: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import spawn World dumping... see /opt/stack/logs/worlddump-2022-12-29-234955.txt for details

I haven't tried anything since I don't know where to start.

Upvotes: -2

Views: 2349

Answers (2)

Stephen C
Stephen C

Reputation: 719386

You don't say which release of OpenStack / devstack you are using.

According to issue 2009229 on Launchpad, this deprecation has been addressed in the Zuul release of devstack.

But this warning is a minor thing ... and won't have any practical impact unless you try to run this version of the devstack scripts on Python 3.12 or later.

Python 3.12 is not expected to be released until October 2023 according to PEP 693. And it will be some time1 before Python 3.12 makes it into a supported platform for OpenStack. Now you could push the envelope and try to run OpenStack on an unsupported platform ... but why take the risk?


1 - At least a year. If the past history is predictive, the 2024.1 OpenStack release will be the first one to support Ubuntu 24.04 LTS. That one will be a cross-over release that also supports Ubuntu 24.04 LTS (jammy). See https://ubuntu.com/openstack/docs/supported-versions and https://wiki.ubuntu.com/Releases for more info.

Upvotes: 0

Maz
Maz

Reputation: 79

This warning started to appear from python 3.10. You could use and older version of python, if it works with your other packages. It says this package will be removed in the coming version 3.12. Your program will keep running with this warning, however u can remove it in following ways:

Option 1: Replace the library with setuptools1

Option 2: Replace with copytree 2

Option 3: When nothing works, do this:

$ pip install shutup

Then at the top of the code

import shutup;
shutup.please()

And no warnings will appear anymore. :D :D :D

or you can filter the warnings:

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning) 

Upvotes: 1

Related Questions