11#!/usr/bin/env python3
2- # $Id: configure.py 112856 2026-02-06 18:32:32Z klaus.espenlaub@oracle.com $
2+ # $Id: configure.py 112857 2026-02-06 19:37:10Z klaus.espenlaub@oracle.com $
33"""
44Configuration script for building VirtualBox.
55
6161# External Python modules or other dependencies are not allowed!
6262#
6363
64- __revision__ = "$Revision: 112856 $"
64+ __revision__ = "$Revision: 112857 $"
6565
6666import argparse
6767import ctypes
@@ -2764,7 +2764,7 @@ def checkCallback_PythonModules(self):
27642764 self .printVerbose (1 , 'Python disbled, skipping' );
27652765 return True ;
27662766
2767- asModulesToCheck = [ 'packaging' ]; # Required by XPCOM.
2767+ asModulesToCheck = [ 'packaging' ]; # Required by VirtualBox API bindings (both COM and XPCOM) .
27682768
27692769 self .printVerbose (1 , 'Checking modules ...' );
27702770
@@ -2773,6 +2773,16 @@ def checkCallback_PythonModules(self):
27732773 self .printVerbose (1 , f"Checking module '{ sCurMod } '" );
27742774 importlib .import_module (sCurMod );
27752775 except ImportError :
2776+ # Hack to accept distutils for now as a substitute to the packaging module.
2777+ if sCurMod == 'packaging' :
2778+ try :
2779+ self .printVerbose (1 , f"Checking module 'distutils'" );
2780+ importlib .import_module ('distutils' );
2781+ except ImportError :
2782+ self .printWarn (f"Python module '{ sCurMod } ' or 'distutils' is not installed" );
2783+ self .print (f"Hint: Try running 'pip install { sCurMod } ' (or 'pip install distutils')" );
2784+ return False ;
2785+ continue ;
27762786 self .printWarn (f"Python module '{ sCurMod } ' is not installed" );
27772787 self .print (f"Hint: Try running 'pip install { sCurMod } '" );
27782788 return False ;
0 commit comments