我正在尝试使用注释工具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'
以下内容适用于 Windows,使用 Anaconda python 3.5 构建(并安装所有依赖项):
pip install git+https://github.com/cvhciKIT/sloth.git
conda install -c anaconda pyqt=4.11.4
conda install scikit-image
Sloth 是一个可执行的 Python 脚本。因此,要运行它,您可以从终端调用它:
PATH_PREFIX_TO_YOUR_PYTHON/Python27/Lib/site-packages/sloth/bin/sloth
您可以通过编辑 .bashrc
文件将树懒脚本目录添加到您的 PATH
:
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
Windows下完成安装“sloth”:
conda create -n slo_py35 python=3.5
activate slo_py35
git config --global http.proxy http://proxy.xxx.de:port #only if proxy available
pip install git+https://github.com/cvhciKIT/sloth.git
conda install -c anaconda pyqt=4.11.4
conda install scikit-image #or if it does not work, take: pip install scikit-image
conda env list #shows the path to the installation
for example: D:\...\anaconda3\envs\slo_py35\
D:\...\anaconda3\envs\slo_py35\sloth\bin> python sloth
D:\...\anaconda3\envs\slo_py35\sloth\bin> python sloth D:\xxx\examples\example1_labels.json
FileNotFoundError: No such file or directory: 'D:\...\anaconda3\envs\slo_py35\lib\site-packages\sloth\gui\labeltool.ui'
D:\...\anaconda3\envs\slo_py35\sloth\gui\labeltool.ui
只需要将ui文件复制到正确的路径,查看错误消息,然后就可以运行了。