pythonvirtualenv:Can';无法正确运行bash脚本
我已经下载并在我的Ubuntu机器上的VirtualNV中安装了,使用-:pythonvirtualenv:Can';无法正确运行bash脚本,python,bash,virtualenv,Python,Bash,Virtualenv,我已经下载并在我的Ubuntu机器上的VirtualNV中安装了,使用-: $ 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:
$ 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
在虚拟环境中运行时,文档会遗漏该步骤。您能否显示
运行测试的内容?@AvihooMamka将run-test的内容附加到了后面。如果您在virtualenv下使用pip
安装了OCROpus
,则需要以下两个选项之一:1。在脚本中导出路径以指向所需的可执行文件。2.给出可执行文件的完整路径。e、 g:/path/to/virtualenv/bin/ocropus nlbin…您是否从虚拟环境中运行了python setup.py安装
。当在虚拟环境中运行时,文档会遗漏该步骤。@JaseRieger它起作用了。谢谢把你的评论变成一个答案,这样我就可以接受了。谢谢你的提示。我现在相应地更新了ocropy中的文档(PR#196)。