Known Issue: Problem importing win32com.client

Posted by grahams on 2018-01-09 14:58

Known to appear in 3.5 and 3.6 ActivePythons, but could affect other versions as well.

Symptom: When running
import win32com.client
an error is reported.
(site-packages\win32com\gen_py\ does not exist)

The win32com module is designed to create and dicts.dat the first time it starts. If the files do not exist and the current user does not have adequate permissions to create the files, the error above will be reported.

The files only need to be created once. If an Admin ID with the correct permissions runs
import win32com.client
the necessary files will be available for future users who do not have elevated permissions.