I have recently returned to using Pyxll to link Excel to Python (of which more later), which required the installation of a 32 bit version of Python 3.7. First trials after installation returned the message: “AttributeError: ‘module’ object has no attribute ‘CLSIDToPackageMap’“.
Fortunately someone else had had the same problem, raised a question on Stackoverflow, then answered his own question about 12 hours later:
After deleting C:\Temp\gen_py, the code above works again. Hope it can save trouble!
The same trick also worked for me, and is continuing to work with no further problems.
My gen_py folder was located at c:\Users\douga\AppData\Local\Temp\gen_py\, even though my Python installation was on my D: drive, and just in case anyone might be concerned about deleting a system folder, it contains the message: “# Generated file – this directory may be deleted to reset the COM cache…”