Python Problems

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…”

 

 

This entry was posted in Computing - general, Link to Python, NumPy and SciPy and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.