悠哉杂学 - numpy
type: channel
link: https://uinit.cn/index.php/tag/numpy/
items: No module named 'numpy.distutils._msvccompiler' in numpy.distutils

No module named 'numpy.distutils._msvccompiler' in numpy.distutils
type: item
date: 2021-07-01T10:52:34+08:00
description: 最新在学习Python的OCR图片文字识别，需要使用cnocr。cnocr 是 Python 3 下的中英文OCR工具包，自带了多个训练好的识别模型（最小模型仅 4.7M），安装后即可直接使用。cnocr主要针对的是排版简单的印刷体文字图片，如截图图片，扫描件等。目前内置的文字检测和分行模块无法处理复杂的文字排版定位。如果要用于场景文字图片的识别，需要结合其他的场景文字检测引擎使用，例如同样基于MXNet 的文字检测引擎 cnstd 。可是我在安装中文cnocr识别时，报了如下一堆错误。D:\Python>pip install cnocr Collecting cnocr Using cached cnocr-1.2.2-py3-none-any.whl (50 kB) Collecting numpy<1.20.0,>=1.14.0 Downloading numpy-1.19.5-cp39-cp39-win_amd64.whl (13.3 MB) |████████████████████████████████| 13.3 MB 3.2 MB/s Collecting mxnet<1.7.0,>=1.5.0 Using cached mxnet-1.6.0-py2.py3-none-win_amd64.whl (26.9 MB) Collecting gluoncv<0.7.0,>=0.3.0 Using cached gluoncv-0.6.0-py2.py3-none-any.whl (693 kB) Requirement already satisfied: pillow>=5.3.0 in c:\python\python39\lib\site-packages (from cnocr) (8.1.2) Requirement already satisfied: matplotlib in c:\python\python39\lib\site-packages (from gluoncv<0.7.0,>=0.3.0->cnocr) (3.3.4) Collecting tqdm Using cached tqdm-4.61.1-py2.py3-none-any.whl (75 kB) Requirement already satisfied: scipy in c:\python\python39\lib\site-packages (from gluoncv<0.7.0,>=0.3.0->cnocr) (1.6.1) Collecting portalocker Using cached portalocker-2.3.0-py2.py3-none-any.whl (15 kB) Requirement already satisfied: requests in c:\python\python39\lib\site-packages (from gluoncv<0.7.0,>=0.3.0->cnocr) (2.20.0) Collecting graphviz<0.9.0,>=0.8.1 Using cached graphviz-0.8.4-py2.py3-none-any.whl (16 kB) Collecting requests Using cached requests-2.18.4-py2.py3-none-any.whl (88 kB) Collecting numpy<1.20.0,>=1.14.0 Using cached numpy-1.16.6.zip (5.1 MB) Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\python\python39\lib\site-packages (from requests->gluoncv<0.7.0,>=0.3.0->cnocr) (3.0.4) Requirement already satisfied: certifi>=2017.4.17 in c:\python\python39\lib\site-packages (from requests->gluoncv<0.7.0,>=0.3.0->cnocr) (2018.8.24) Requirement already satisfied: urllib3<1.23,>=1.21.1 in c:\python\python39\lib\site-packages (from requests->gluoncv<0.7.0,>=0.3.0->cnocr) (1.22) Collecting idna<2.7…