Problem

The DHL Shipping module for Magento 2 cannot be enabled with the following command:


php bin/magento module:enable Dhl_Shipping


This error message occurs:


Unable to change status of modules because of the following constraints:

Cannot enable Dhl_Shipping because it depends on disabled modules:

Dhl_LabelStatus: Dhl_Shipping->Dhl_LabelStatus


When trying to enable the Module Dhl_LabelStatus first, a very similar error shows up:


Unable to change status of modules because of the following constraints:

Cannot enable Dhl_LabelStatus because it depends on disabled modules:

Dhl_Shipping: Dhl_LabelStatus->Dhl_Shipping


Cause

There is a circular dependency between the modules DHL Shipping and DHL Label Status.


Solution

Both modules must be enabled at the same time using a single command:


php bin/magento module:enable Dhl_Shipping Dhl_LabelStatus