[Solved] Win10 Warning: ModuleNotFoundError: No module named ‘win32con‘ and No module named ‘antlr4‘

In the last article, win10 installs detectron2 (0.1 or 0.4.1) based on Python 1.8.1 and cuda11.1.1. After installing detectron2, run the test Demo:

python demo/demo.py --config-file configs/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x
.yaml   --input predict\input\1.jpg   --output predict\output --opts MODEL.WEIGHTS weights/e2e_mask_rcnn_R-101-FPN_1x.pkl

The following error occurred:

No module named ‘win32con’ and no module named ‘antlr4’

It is useless to install through pip, but there are two libraries through PIP list query

By directly looking at the file addresses of the above two packages, we found that there was no relevant py file in them. Finally, we successfully solved the problem by installing the compiled binary WHL file

pip install antlr4_python3_runtime-4.9.2-py3-none-any.whl
pip install pywin32-300-cp36-cp36m-win_amd64.whl

Run the command again to get the output:

Read More: