【发布时间】:2020-01-03 12:00:49
【问题描述】:
每当我输入命令时 - pip3 安装 tesserocr -
它给出错误 -
收集 tesserocr
Using cached https://files.pythonhosted.org/packages/e3/77/fb26b321c3b9ce4a47af12b19e85ddbf4d0629adb6552d85276e824e6e51/tesserocr-2.5.0.tar.gz
为收集的包构建轮子:tesserocr tesserocr (setup.py) 的构建轮...错误
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
【问题讨论】:
-
pip3 冻结-anytree==2.7.2 blis==0.4.1 boto==2.49.0 boto3==1.10.20 botocore==1.13.20 certifi==2019.9.11 chardet== 3.0.4 循环器==0.10.0 cymem==2.0.3 Cython==0.24.1 Django==2.2.7 django-cors-headers==3.1.1 django-js-asset==1.2.2 django-mptt ==0.10.0 django-pandas==0.6.1 djangorestframework==3.10.3 djangorestframework-bulk==0.2.1 docutils==0.15.2 # en-core-web-sm==2.2.0 # pip install en -core-web-sm-abd gensim==3.8.1 idna==2.8
-
importlib-metadata==0.23 jmespath==0.9.4 joblib==0.14.0 kiwisolver==1.1.0 matplotlib==3.1.1 more-itertools==7.2.0 murmurhash==1.0 .2 # mysqlclient==1.4.4 nltk==3.4.5
-
numpy==1.17.2 opencv-python==4.1.1.26 pandas==0.25.1 pdf2image==1.9.0 Pillow==6.2.0 # pkg-resources==0.0.0 plac ==1.1.3 preshed==3.0.2 PyMySQL==0.9.3 pyparsing==2.4.5 PyPDF2==1.26.0 pytesseract==0.3.0 python-dateutil==2.8.0 pytz==2019.2 requests== 2.22.0 s3transfer==0.2.1 scikit-learn==0.21.3 scipy==1.3.2 六==1.12.0 sklearn==0.0 smart-open==1.9.0 spacy==2.2.2 SpeechRecognition== 3.8.1 sqlparse==0.3.0 srsly==0.2.0 停用词==2018.7.23 tesserocr==2.4.1 textblob==0.15.3 Thinc==7.3.1 tqdm==4.38.0 urllib3== 1.25.7 魔杖==0.5.7 芥末==0.4.0
-
最好把这些都放到问题部分。
标签: python django python-3.x django-rest-framework migration