简体   繁体   中英

python-virtualenv : Can't run bash script properly

I am have downloaded the OCROpus Reader and have installed it in a virtualenv in my Ubuntu machine using -:

$ 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/

Now when I following command-:

$ ./run-test

I get the error-:

./run-test: line 4: ocropus-nlbin: command not found

Is this a problem because I have installed OCROpus in a virtual environment ? Is the shell script unable to find the PATH to installed packages ?

Need some help.

The content of 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"

You need to run python setup.py install from within the virtual env.

The documentation misses that step when running in a virtual env.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM