英文:
Running setup.py install for tesserocr ... error
问题
每当我输入以下命令时 -
pip3 install tesserocr -
它会出现错误 -
Collecting tesserocr
Using cached https://files.pythonhosted.org/packages/e3/77/fb26b321c3b9ce4a47af12b19e85ddbf4d0629adb6552d85276e824e6e51/tesserocr-2.5.0.tar.gz
Building wheels for collected packages: tesserocr
Building wheel for tesserocr (setup.py) ... error
tesserocr.cpp:8586:43: error: ‘class tesseract::ResultIterator’ has no member named ‘GetBestLSTMSymbolChoices’
__pyx_v_output = (__pyx_v_self-> _riter-> GetBestLSTMSymbolChoices()[0]);
^~~~~~~~~~~~~~~~~~~~~~~~
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
----------------------------------------
ERROR: 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
ERROR: Command errored out with exit status 1:
command: /home/hostbooks/django1/myproject/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = """""""/tmp/pip-install-7nxw40tx/tesserocr/setup.py"""""""; __file__="""""""/tmp/pip-install-7nxw40tx/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 /tmp/pip-record-p51ckvh8/install-record.txt --single-version-externally-managed --compile --install-headers /home/hostbooks/django1/myproject/include/site/python3.6/tesserocr
cwd: /tmp/pip-install-7nxw40tx/tesserocr/
Complete output (14 lines):
Supporting tesseract v4.0.0
Building with configs: {'libraries': ['tesseract', 'lept'], 'cython_compile_time_env': {'TESSERACT_VERSION': 67108864}}
running install
running build
running build_ext
building 'tesserocr' extension
creating build
creating build/temp.linux-x86_64-3.6
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -I/home/hostbooks/django1/myproject/include/python3.6m -c tesserocr.cpp -o build/temp.linux-x86_64-3.6/tesserocr.o -std=c++11 -DUSE_STD_NAMESPACE
tesserocr.cpp: In function ‘PyObject* __pyx_pf_9tesserocr_16PyResultIterator_8GetBestLSTMSymbolChoices(__pyx_obj_9tesserocr_PyResultIterator*)’:
tesserocr.cpp:8586:43: error: ‘class tesseract::ResultIterator’ has no member named ‘GetBestLSTMSymbolChoices’
__pyx_v_output = (__pyx_v_self-> _riter-> GetBestLSTMSymbolChoices()[0]);
^~~~~~~~~~~~~~~~~~~~~~~~
error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/hostbooks/django1/myproject/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = """""""/tmp/pip-install-7nxw40tx/tesserocr/setup.py"""""""; __file__="""""""/tmp/pip-install-7nxw40tx/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 /tmp/pip-record-p51ckvh8/install-record.txt --single-version-externally-managed --compile --install-headers /home/hostbooks/django1/myproject/include/site/python3.6/tesserocr Check the logs for full command output.
如何解决这个错误。
我的虚拟环境名称是 - myproject
<details>
<summary>英文:</summary>
When ever I enter for command -
pip3 install tesserocr -
It gives error -
Collecting tesserocr
Using cached https://files.pythonhosted.org/packages/e3/77/fb26b321c3b9ce4a47af12b19e85ddbf4d0629adb6552d85276e824e6e51/tesserocr-2.5.0.tar.gz
Building wheels for collected packages: tesserocr
Building wheel for tesserocr (setup.py) ... error
tesserocr.cpp:8586:43: error: ‘class tesseract::ResultIterator’ has no member named ‘GetBestLSTMSymbolChoices’
__pyx_v_output = (__pyx_v_self->_riter->GetBestLSTMSymbolChoices()[0]);
^~~~~~~~~~~~~~~~~~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: 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
ERROR: Command errored out with exit status 1:
command: /home/hostbooks/django1/myproject/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7nxw40tx/tesserocr/setup.py'"'"'; __file__='"'"'/tmp/pip-install-7nxw40tx/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 /tmp/pip-record-p51ckvh8/install-record.txt --single-version-externally-managed --compile --install-headers /home/hostbooks/django1/myproject/include/site/python3.6/tesserocr
cwd: /tmp/pip-install-7nxw40tx/tesserocr/
Complete output (14 lines):
Supporting tesseract v4.0.0
Building with configs: {'libraries': ['tesseract', 'lept'], 'cython_compile_time_env': {'TESSERACT_VERSION': 67108864}}
running install
running build
running build_ext
building 'tesserocr' extension
creating build
creating build/temp.linux-x86_64-3.6
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -I/home/hostbooks/django1/myproject/include/python3.6m -c tesserocr.cpp -o build/temp.linux-x86_64-3.6/tesserocr.o -std=c++11 -DUSE_STD_NAMESPACE
tesserocr.cpp: In function ‘PyObject* __pyx_pf_9tesserocr_16PyResultIterator_8GetBestLSTMSymbolChoices(__pyx_obj_9tesserocr_PyResultIterator*)’:
tesserocr.cpp:8586:43: error: ‘class tesseract::ResultIterator’ has no member named ‘GetBestLSTMSymbolChoices’
__pyx_v_output = (__pyx_v_self->_riter->GetBestLSTMSymbolChoices()[0]);
^~~~~~~~~~~~~~~~~~~~~~~~
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/hostbooks/django1/myproject/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-7nxw40tx/tesserocr/setup.py'"'"'; __file__='"'"'/tmp/pip-install-7nxw40tx/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 /tmp/pip-record-p51ckvh8/install-record.txt --single-version-externally-managed --compile --install-headers /home/hostbooks/django1/myproject/include/site/python3.6/tesserocr Check the logs for full command output.
How should I remove this error.
Name of my virtual environment is - myproject
</details>
# 答案1
**得分**: 0
以下是已翻译的内容:
对我来说,以后这些命令用于解决错误 -
pip3 install pytesseract
apt install pkg-config
sudo apt install pkg-config
install - 成功安装 -
Wand-0.5.7
tesserocr-2.4.1
tqdm-4.38.0
sudo apt-get update
这些命令解决了我的错误。
<details>
<summary>英文:</summary>
For me later on these command goes for the error -
pip3 install pytesseract
apt install pkg-config
sudo apt install pkg-config
install - Successfully installed -
Wand-0.5.7
tesserocr-2.4.1
tqdm-4.38.0
sudo apt-get update
these command removed my error.
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论