我已经下载了 OCROpus Reader并使用 -:
将其安装在我的 Ubuntu 机器的 virtualenv 中$ virtualenv ocropus_venv/
$ source ocropus_venv/bin/activate
$ pip install -r requirements_1.txt
# tables has some dependencies which must be installed first:
$ pip install -r requirements_2.txt
$ wget -nd http://www.tmbdev.net/en-default.pyrnn.gz
$ mv en-default.pyrnn.gz models/
现在当我执行命令时:
$ ./run-test
我收到错误-:
./run-test: line 4: ocropus-nlbin: command not found
这是因为我在虚拟环境中安装了 OCROpus 导致的问题吗? shell 脚本是否无法找到已安装软件包的路径?
需要一些帮助。
run-test.sh的内容是-:
#!/bin/bash -e
rm -rf temp
ocropus-nlbin tests/testpage.png -o temp
ocropus-gpageseg 'temp/????.bin.png'
ocropus-rpred -n 'temp/????/??????.bin.png'
ocropus-hocr 'temp/????.bin.png' -o temp.html
ocropus-visualize-results temp
ocropus-gtedit html temp/????/??????.bin.png -o temp-correction.html
echo "to see recognition results, type: firefox temp.html"
echo "to see correction page, type: firefox temp-correction.html"
echo "to see details on the recognition process, type: firefox temp/index.html"
最佳答案
您需要从虚拟环境中运行python setup.py install
。
在虚拟环境中运行时,文档缺少该步骤。
关于python-virtualenv : Can't run bash script properly,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35770134/