2016-03-03 100 views
2

我已经下载了OCROpus Reader和使用我的Ubuntu机器的virtualenv已经安装了它 - :蟒蛇-的virtualenv:不能运行bash脚本正确

$ 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脚本无法找到安装软件包的PATH?

需要一些帮助。

run-test.sh IS-的内容:

#!/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" 
+0

你可以显示'run-test'的内容吗? –

+0

@AvihooMamka附加run-test.sh的内容 – Machina333

+0

如果您在virtualenv下使用'pip'安装'OCROpus',则需要以下两项之一:1.在脚本中导出PATH以指向所需的可执行文件。 2.给出可执行文件的完整路径。例如:/ path/to/virtualenv/bin/ocropus-nlbin ... –

回答

5

您需要从虚拟ENV中运行python setup.py install

在虚拟环境中运行时,文档没有执行该步骤。

+0

谢谢你的提示。我相应地更新了ocropy的文档(PR#196)。 – zuphilip