2016-03-03 53 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