2015-10-19 71 views
3

我试图使用注释工具Sloth。 如何让程序运行?可以运行懒惰注释工具

JMAIR-3:sloth user$ which python 
/usr/local/bin/python 
JMAIR-3:sloth user$ python --version 
Python 2.7.10 
JMAIR-3:sloth user$ brew install PyQt 
Warning: pyqt-4.11.4 already installed 
JMAIR-3:sloth user$ ls 
COPYING  LICENSE  README.md build  doc  examples scripts  setup.py sloth  tests 
JMAIR-3:sloth user$ sloth 
-bash: sloth: command not found 
JMAIR-3:sloth user$ sudo python setup.py install 
Password: 
running install 
running build 
running build_py 
running build_scripts 
running install_lib 
running install_scripts 
changing mode of /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/bin/sloth to 755 
running install_data 
running install_egg_info 
Removing /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sloth-1.0-py2.7.egg-info 
Writing /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sloth-1.0-py2.7.egg-info 
JMAIR-3:sloth user$ sloth 
-bash: sloth: command not found 
JMAIR-3:sloth user$ sloth examples/example1_labels.json 
-bash: sloth: command not found 


python sloth 
/usr/local/opt/python/bin/python2.7: can't find 'main' module in 'sloth' 
+1

我试图在Windows上运行它,有类似的问题。 –

回答

2

懒惰是一个可执行的Python脚本。因此,要运行它,你可以从终端调用它:

PATH_PREFIX_TO_YOUR_PYTHON/Python27/Lib/site-packages/sloth/bin/sloth 

你可能add sloth script directory to your PATH,通过编辑YOUT .bashrc文件:

export PATH=$PATH:PUT_PATH_TO_SLOTH_HERE 

然后运行source .bashrc为了使更改生效。之后,在终端窗口中输入sloth应该打开GUI。

在Windows中,我设法运行它使用Git Bash(默认情况下,Windows的Git安装提供了一个Bash模拟器)。在一个Git Bash终端窗口,使用下面的(你可能需要恰克如果你的Python安装目录是不同的):

/c/Python27/Lib/site-packages/sloth/bin/sloth 
+0

这听起来很标准,但是即使在按照你所描述的方式导出路径并找到它之后(我为大多数其他成功的软件包所做的),仍然不会找到懒惰的命令。所以也许我得到了一个懒惰不期望的非标准安装路径或者什么.. – jsky

0

对我来说,在Windows上,它以下面的方式

git clone https://github.com/cvhciKIT/sloth.git 
cd sloth 
python setup.py install 
python sloth/bin/sloth examples/example1_labels.json 
1

的下面的作品在Windows上,与蟒蛇python 3.5生成(并安装所有依赖项):

pip install git+https://github.com/cvhciKIT/sloth.git 
conda install -c anaconda pyqt=4.11.4 
conda install scikit-image