Problem

After installing the DHL Shipping module for Magento 2, this (or a similar) error occurs:


PHP Fatal error: Interface [...] not found


PHP Fatal error: Uncaught Error: Class [...] not found


Source class [...] for [...] generation does not exist


Cause

The required library lib-shipping-mx has not been installed together with the DHL Shipping module.


For the installation in Magento 2, it does not suffice to only copy the files of the DHL Shipping module into the Magento directory.


Solution

Install the DHL Shipping module as explained in the README.md in section "Installation instructions". This way, the required library will be installed.


When installing the module with Composer, the library will automatically be installed.