python-virtualenv : Can't run bash script properly

标签 python bash virtualenv

我已经下载了 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/

相关文章:

python - 在文件路径中测试 '/../' 是否足以防止转义子目录?

linux - crontab 用于调度 shell 脚本

python - 是否可以在 virtualenv 设置后设置 --no-site-packages ?

python - 如何将多个python脚本混合成一个shell脚本?

python - 循环浏览列表中保留原始索引号的特定项目

python - 数组+标量? C

mysql - 要运行的字符串

linux - 当在另一个脚本中运行bash脚本时,父脚本中定义的所有变量是否都会继承给子脚本?

Python Virtualenv 检查环境

python - 按特定列对矩阵进行排序(具有 2 位或更多数字)