今天在Python 3.6環(huán)境中,需要安裝tesserocr模塊,在安裝的過程中遇到了“error: Microsoft Visual C++ 14.0 is required…” 的問題,找到的解決辦法:
常規(guī)的安裝模塊包都是通過:
- pip install xxx
- conda install xxx
- github下載并解壓:
wget https://github.com/UB-Mannheim/tesseract/archive/3.05.02.zip
unzip 解壓
rm 壓縮包
cd 目錄
安裝依賴包:
pip install -r requirements.txt
安裝模塊
python setup.py install
還有一種方法:
https://www.lfd.uci.edu/~gohlke/pythonlibs/ 頁面下載所需的模塊的whl文件,下載后進(jìn)入存儲該文件的路徑,按照方法一,執(zhí)行“pip install xxx-1.2.1-cp36-cp36m-win_amd64.whl”,這樣就會安裝成功。
但是,上面沒有tesserocr模塊,最終在https://pypi.org/上找到了tesserocr模塊的description,記載了詳細(xì)的安裝方法。
Conda
You can use the channel `simonflueckiger <https://anaconda.org/simonflueckiger/tesserocr>`_ to install from Conda:
::
> conda install -c simonflueckiger tesserocr
or to get **tesserocr** compiled with **tesseract 4.0.0**:
::
> conda install -c simonflueckiger/label/tesseract-4.0.0-master tesserocr
pip
Download the wheel file corresponding to your Windows platform and
Python installation from `simonflueckiger/tesserocr-windows_build/releases
<https://github.com/simonflueckiger/tesserocr-windows_build/releases>`_ and install them via:
::
> pip install <package_name>.whl