解决windows安装tesserocr报错问题 Failed building wheel for tesserocr

在我安装tesserocr的过程中出现了报错

C:\Users\Administrator>pip3 install tesserocr pillow
Collecting tesserocr
Using cached https://files.pythonhosted.org/packages/cf/0d/9e554f041962b8dd7acd978330535fed879452bb0af257c287ca4ae9c525/tesserocr-2.2.2.tar.gz
Requirement already satisfied: pillow in d:\anaconda\lib\site-packages (5.0.0)
Building wheels for collected packages: tesserocr
Running setup.py bdist_wheel for tesserocr ... error
Complete output from command d:\anaconda\python.exe -u -c "import setuptools, tokenize;__file__=‘C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-i9u0iczd\\tesserocr\\setup.py‘;f=getattr(tokenize, ‘open‘, open)(__file__);code=f.read().replace(‘\r\n‘, ‘\n‘);f.close();exec(compile(code, __file__, ‘exec‘))" bdist_wheel -d C:\Users\ADMINI~1\AppData\Local\Temp\pip-wheel-op2ibo5_ --python-tag cp36:
Supporting tesseract v3.05.01
Building with configs: {‘libraries‘: [‘tesseract‘, ‘lept‘], ‘cython_compile_time_env‘: {‘TESSERACT_VERSION‘: 197889}}
running bdist_wheel
running build
running build_ext
building ‘tesserocr‘ extension
creating build
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:\anaconda\include -Id:\anaconda\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" /EHsc /Tptesserocr.cpp /Fobuild\temp.win-amd64-3.6\Release\tesserocr.obj
tesserocr.cpp
tesserocr.cpp(555): fatal error C1083: 无法打开包括文件: “leptonica/allheaders.h”: No such file or directory
error: command ‘C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x64\\cl.exe‘ failed with exit status 2

----------------------------------------
Failed building wheel for tesserocr
Running setup.py clean for tesserocr
Failed to build tesserocr
Installing collected packages: tesserocr
Running setup.py install for tesserocr ... error
Complete output from command d:\anaconda\python.exe -u -c "import setuptools, tokenize;__file__=‘C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-i9u0iczd\\tesserocr\\setup.py‘;f=getattr(tokenize, ‘open‘, open)(__file__);code=f.read().replace(‘\r\n‘, ‘\n‘);f.close();exec(compile(code, __file__, ‘exec‘))" install --record C:\Users\ADMINI~1\AppData\Local\Temp\pip-record-1olmw2pc\install-record.txt --single-version-externally-managed --compile:
Supporting tesseract v3.05.01
Building with configs: {‘libraries‘: [‘tesseract‘, ‘lept‘], ‘cython_compile_time_env‘: {‘TESSERACT_VERSION‘: 197889}}
running install
running build
running build_ext
building ‘tesserocr‘ extension
creating build
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Id:\anaconda\include -Id:\anaconda\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt" /EHsc /Tptesserocr.cpp /Fobuild\temp.win-amd64-3.6\Release\tesserocr.obj
tesserocr.cpp
tesserocr.cpp(555): fatal error C1083: 无法打开包括文件: “leptonica/allheaders.h”: No such file or directory
error: command ‘C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.12.25827\\bin\\HostX86\\x64\\cl.exe‘ failed with exit status 2

----------------------------------------
Command "d:\anaconda\python.exe -u -c "import setuptools, tokenize;__file__=‘C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\pip-install-i9u0iczd\\tesserocr\\setup.py‘;f=getattr(tokenize, ‘open‘, open)(__file__);code=f.read().replace(‘\r\n‘, ‘\n‘);f.close();exec(compile(code, __file__, ‘exec‘))" install --record C:\Users\ADMINI~1\AppData\Local\Temp\pip-record-1olmw2pc\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ADMINI~1\AppData\Local\Temp\pip-install-i9u0iczd\tesserocr\

报错如上图所示,我初期也不懂到底是什么问题引起的,之后我看了下网上的搜索结果,发现原来是我安装了Anaconda的原因。同时,也找到了解决方法

解决方法就是在cmd中输入

conda install -c simonflueckiger tesserocr

查了下conda install 发现conda是针对于python的。可以安装minconda或anaconda进行安装。所以在安装了Anaconda的条件下,我们可以通过conda install安装tesserocr

参考链接

https://blog.csdn.net/koflance/article/details/78582737

https://blog.csdn.net/badman_h/article/details/80320625

原文地址:https://www.cnblogs.com/chl434723646/p/9161487.html

时间: 2024-10-06 07:59:43

解决windows安装tesserocr报错问题 Failed building wheel for tesserocr的相关文章

解决Mac安装tesserocr报错问题 Failed building wheel for

localhost:~ jerry$ Processing /var/www/git/python/tesserocr -bash: Processing: command not found localhost:~ jerry$ pip3 install tesserocr Collecting tesserocr Using cached https://files.pythonhosted.org/packages/f8/6d/4e81e041f33a4419e59edcb1dbdf3c5

解决cron无法运行报错:FAILED

解决cron无法运行报错:FAILED to authorize user with PAM (Module is unknown) 查看cron运行日志tail -f /var/log/cron报如下错误: May 8 10:14:01 localhost crond[9399]: (root) FAILED to authorize user with PAM (Module is unknown) May 8 10:14:01 localhost crond[9400]: (root) F

安装Keras的问题:Failed building wheel for scipy

安装Keras的过程中出现了下边的问题: Failed building wheel for scipy, Failed cleaning build dir for scipy pip在windows下不工作. 处理办法: 手工下载Scipy: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy 手工安装,pip install scipyname 安装成功提示后,在继续安装Keras, pip install keras.

windows安装channels报错的解决方案

windows作为开发机真是让人又爱又恨,总是会遇到各种各样的问题 报错 以安装channels为例:如: pip install channels   时出现: error: Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”: http://landinghub.visualstudio.com/visual-cpp-build-tools 解决办法 1. 安装 Micro

windows安装pycrypto报错

在Windows上安装的时候直接 pip install pycrypto会报错 由于直接安装安装Crypto模块 会报错如下:因此需要先安装Microsoft Visual C++ 9.0 进入下载网址:https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266,直接下载后点击安装 下载的软件是VCForPython27.msi,安装好后,pip install pycrypto 原文地址:https://www.cn

docker安装完报错:Failed to start docker.service: Unit docker.service is masked

执行 systemctl start docker 报错 Failed to start docker.service: Unit docker.service is masked. 解决 systemctl unmask docker.service systemctl unmask docker.socket systemctl start docker.service 原文地址:https://www.cnblogs.com/chenqionghe/p/11478863.html

python windows 安装paramiko报错

Windows下安装Anaconda,成功安装了paramiko,但是新建paramiko项目时,直接报错.错误信息:Unknown exception: DLL load failed: 操作系统无法运行 %1. from cryptography.hazmat.bindings._openssl import ffi, lib ImportError: DLL load failed: 操作系统无法运行 %1. 解决方式:看错误明显是OpenSSL库加载不成功,:把C:\Windows\Sy

windows安装anaconda报错

Fatal error in launcher: Unable to create process using '"' 解决方法: python3 -m pip install --upgrade pip 原文地址:http://blog.51cto.com/13155409/2111025

解决 genymotion 安装apk报错 app contains ARM native code and your Genymotion device cannot run ARM instructions

1.某些APP安装在模拟器时提示“ this probably means that the app contains ARM native code and your Genymotion device cannot run ARM instructions. You should either build your native code to x86 or install an ARM tanslation tool in your device.” 解决方案:1.下载并安装Genymot