cvhciKIT / sloth

Sloth is a tool for labeling image and video data for computer vision research.
Other
608 stars 198 forks source link

Installing sloth using Anaconda #121

Closed AakashKumarNain closed 7 years ago

AakashKumarNain commented 7 years ago

Is there a way to install and run sloth from a particular environment in Anaconda. I have two environments : one with python2.7 and another with python3.5. When I try to install sloth, it always installs to my root environment (i.e. python2.7) even when I am trying to install it in my python3.5 environment. Any suggestions how to install it ?

stared commented 7 years ago

I had the same issue. It was solved by installing using (Anaconda) pip:

pip install git+git://github.com/cvhciKIT/sloth

rather than the recommended (why?!):

sudo python setup.py install
PuchatekwSzortach commented 7 years ago

Hmm, I can confirm that installing sloth when alternative Anaconda environment is active installs into that environment. Tried it just a moment ago both with pip install sloth and sudo python setup.py install after cloning git to my hard drive.

mrgloom commented 6 years ago

Where sloth is located on Windows after installing via python setup.py install ? Under c:\users\myuser\anaconda3\lib\site-packages I have sloth folder and in in C:\Users\myuser\Anaconda3\Lib\site-packages\sloth\bin I have sloth which is 1kb file without extension.

Pip install from git works, but I still can't understand where sloth binary is located:

pip install git+git://github.com/cvhciKIT/sloth
Collecting git+git://github.com/cvhciKIT/sloth
  Cloning git://github.com/cvhciKIT/sloth to c:\users\myuser\appdata\local\temp\
pip-dkb3lo9w-build
Installing collected packages: sloth
  Running setup.py install for sloth ... done
Successfully installed sloth-1.0

And pip install sloth failed:

pip install sloth
Collecting sloth
  Downloading SLOTH-0.0.8.tar.gz (45kB)
    100% |████████████████████████████████| 51kB 276kB/s
Requirement already satisfied: matplotlib>=0.99.3 in c:\users\myuser\anaconda3\l
ib\site-packages (from sloth)
Requirement already satisfied: numpy>=1.5.1 in c:\users\myuser\anaconda3\lib\sit
e-packages (from sloth)
Requirement already satisfied: scipy>=0.8.0 in c:\users\myuser\anaconda3\lib\sit
e-packages (from sloth)
Requirement already satisfied: six>=1.10 in c:\users\myuser\anaconda3\lib\site-p
ackages (from matplotlib>=0.99.3->sloth)
Requirement already satisfied: python-dateutil in c:\users\myuser\anaconda3\lib\
site-packages (from matplotlib>=0.99.3->sloth)
Requirement already satisfied: pytz in c:\users\myuser\anaconda3\lib\site-packag
es (from matplotlib>=0.99.3->sloth)
Requirement already satisfied: cycler>=0.10 in c:\users\myuser\anaconda3\lib\sit
e-packages (from matplotlib>=0.99.3->sloth)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in c:\us
ers\myuser\anaconda3\lib\site-packages (from matplotlib>=0.99.3->sloth)
Building wheels for collected packages: sloth
  Running setup.py bdist_wheel for sloth ... error
  Complete output from command C:\Users\myuser\Anaconda3\python.exe -u -c "impor
t setuptools, tokenize;__file__='C:\\Users\\myuser\\AppData\\Local\\Temp\\pip-bu
ild-93af5sbo\\sloth\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=
f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))"
bdist_wheel -d C:\Users\myuser\AppData\Local\Temp\tmp1siaaimepip-wheel- --python
-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib
  creating build\lib\sloth
  copying sloth\data_reader.py -> build\lib\sloth
  copying sloth\image_analyser_defs.py -> build\lib\sloth
  copying sloth\image_processing.py -> build\lib\sloth
  copying sloth\mean_square_analyser.py -> build\lib\sloth
  copying sloth\read_nd2.py -> build\lib\sloth
  copying sloth\seed_detection.py -> build\lib\sloth
  copying sloth\select_ROI_defs.py -> build\lib\sloth
  copying sloth\tifffile.py -> build\lib\sloth
  copying sloth\vectorial.py -> build\lib\sloth
  copying sloth\__init__.py -> build\lib\sloth
  creating build\lib\sloth\test
  copying sloth\test\test_data_reader.py -> build\lib\sloth\test
  copying sloth\test\__init__.py -> build\lib\sloth\test
  running build_scripts
  creating build\scripts-3.6
  copying and adjusting bin\image_analyser.py -> build\scripts-3.6
  copying and adjusting bin\select_ROI.py -> build\scripts-3.6
  copying and adjusting bin\automatic_analysis1.0.py -> build\scripts-3.6
  copying and adjusting bin\sloth-main.py -> build\scripts-3.6
  Traceback (most recent call last):
    File "C:\Users\myuser\Anaconda3\lib\tokenize.py", line 390, in find_cookie
      line_string = line.decode('utf-8')
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 6: invali
d continuation byte

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\myuser\AppData\Local\Temp\pip-build-93af5sbo\sloth\setup.py",
 line 17, in <module>
      "scipy  >= 0.8.0"
    File "C:\Users\myuser\Anaconda3\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "C:\Users\myuser\Anaconda3\lib\distutils\dist.py", line 955, in run_com
mands
      self.run_command(cmd)
    File "C:\Users\myuser\Anaconda3\lib\distutils\dist.py", line 974, in run_com
mand
      cmd_obj.run()
    File "C:\Users\myuser\Anaconda3\lib\site-packages\wheel\bdist_wheel.py", lin
e 179, in run
      self.run_command('build')
    File "C:\Users\myuser\Anaconda3\lib\distutils\cmd.py", line 313, in run_comm
and
      self.distribution.run_command(command)
    File "C:\Users\myuser\Anaconda3\lib\distutils\dist.py", line 974, in run_com
mand
      cmd_obj.run()
    File "C:\Users\myuser\Anaconda3\lib\distutils\command\build.py", line 135, i
n run
      self.run_command(cmd_name)
    File "C:\Users\myuser\Anaconda3\lib\distutils\cmd.py", line 313, in run_comm
and
      self.distribution.run_command(command)
    File "C:\Users\myuser\Anaconda3\lib\distutils\dist.py", line 974, in run_com
mand
      cmd_obj.run()
    File "C:\Users\myuser\Anaconda3\lib\distutils\command\build_scripts.py", lin
e 50, in run
      self.copy_scripts()
    File "C:\Users\myuser\Anaconda3\lib\distutils\command\build_scripts.py", lin
e 82, in copy_scripts
      encoding, lines = tokenize.detect_encoding(f.readline)
    File "C:\Users\myuser\Anaconda3\lib\tokenize.py", line 431, in detect_encodi
ng
      encoding = find_cookie(first)
    File "C:\Users\myuser\Anaconda3\lib\tokenize.py", line 395, in find_cookie
      raise SyntaxError(msg)
  SyntaxError: invalid or missing encoding declaration for 'Sloth3.gif'

  ----------------------------------------
  Failed building wheel for sloth
  Running setup.py clean for sloth
Failed to build sloth
Installing collected packages: sloth
  Running setup.py install for sloth ... error
    Complete output from command C:\Users\myuser\Anaconda3\python.exe -u -c "imp
ort setuptools, tokenize;__file__='C:\\Users\\myuser\\AppData\\Local\\Temp\\pip-
build-93af5sbo\\sloth\\setup.py';f=getattr(tokenize, 'open', open)(__file__);cod
e=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))
" install --record C:\Users\myuser\AppData\Local\Temp\pip-1wm3o7e3-record\instal
l-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib
    creating build\lib\sloth
    copying sloth\data_reader.py -> build\lib\sloth
    copying sloth\image_analyser_defs.py -> build\lib\sloth
    copying sloth\image_processing.py -> build\lib\sloth
    copying sloth\mean_square_analyser.py -> build\lib\sloth
    copying sloth\read_nd2.py -> build\lib\sloth
    copying sloth\seed_detection.py -> build\lib\sloth
    copying sloth\select_ROI_defs.py -> build\lib\sloth
    copying sloth\tifffile.py -> build\lib\sloth
    copying sloth\vectorial.py -> build\lib\sloth
    copying sloth\__init__.py -> build\lib\sloth
    creating build\lib\sloth\test
    copying sloth\test\test_data_reader.py -> build\lib\sloth\test
    copying sloth\test\__init__.py -> build\lib\sloth\test
    running build_scripts
    creating build\scripts-3.6
    copying and adjusting bin\image_analyser.py -> build\scripts-3.6
    copying and adjusting bin\select_ROI.py -> build\scripts-3.6
    copying and adjusting bin\automatic_analysis1.0.py -> build\scripts-3.6
    copying and adjusting bin\sloth-main.py -> build\scripts-3.6
    Traceback (most recent call last):
      File "C:\Users\myuser\Anaconda3\lib\tokenize.py", line 390, in find_cookie

        line_string = line.decode('utf-8')
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 6: inva
lid continuation byte

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\myuser\AppData\Local\Temp\pip-build-93af5sbo\sloth\setup.py
", line 17, in <module>
        "scipy  >= 0.8.0"
      File "C:\Users\myuser\Anaconda3\lib\distutils\core.py", line 148, in setup

        dist.run_commands()
      File "C:\Users\myuser\Anaconda3\lib\distutils\dist.py", line 955, in run_c
ommands
        self.run_command(cmd)
      File "C:\Users\myuser\Anaconda3\lib\distutils\dist.py", line 974, in run_c
ommand
        cmd_obj.run()
      File "C:\Users\myuser\Anaconda3\lib\site-packages\setuptools\command\insta
ll.py", line 61, in run
        return orig.install.run(self)
      File "C:\Users\myuser\Anaconda3\lib\distutils\command\install.py", line 54
5, in run
        self.run_command('build')
      File "C:\Users\myuser\Anaconda3\lib\distutils\cmd.py", line 313, in run_co
mmand
        self.distribution.run_command(command)
      File "C:\Users\myuser\Anaconda3\lib\distutils\dist.py", line 974, in run_c
ommand
        cmd_obj.run()
      File "C:\Users\myuser\Anaconda3\lib\distutils\command\build.py", line 135,
 in run
        self.run_command(cmd_name)
      File "C:\Users\myuser\Anaconda3\lib\distutils\cmd.py", line 313, in run_co
mmand
        self.distribution.run_command(command)
      File "C:\Users\myuser\Anaconda3\lib\distutils\dist.py", line 974, in run_c
ommand
        cmd_obj.run()
      File "C:\Users\myuser\Anaconda3\lib\distutils\command\build_scripts.py", l
ine 50, in run
        self.copy_scripts()
      File "C:\Users\myuser\Anaconda3\lib\distutils\command\build_scripts.py", l
ine 82, in copy_scripts
        encoding, lines = tokenize.detect_encoding(f.readline)
      File "C:\Users\myuser\Anaconda3\lib\tokenize.py", line 431, in detect_enco
ding
        encoding = find_cookie(first)
      File "C:\Users\myuser\Anaconda3\lib\tokenize.py", line 395, in find_cookie

        raise SyntaxError(msg)
    SyntaxError: invalid or missing encoding declaration for 'Sloth3.gif'

    ----------------------------------------
Command "C:\Users\myuser\Anaconda3\python.exe -u -c "import setuptools, tokenize
;__file__='C:\\Users\\myuser\\AppData\\Local\\Temp\\pip-build-93af5sbo\\sloth\\s
etup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n
', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Us
ers\myuser\AppData\Local\Temp\pip-1wm3o7e3-record\install-record.txt --single-ve
rsion-externally-managed --compile" failed with error code 1 in C:\Users\myuser\
AppData\Local\Temp\pip-build-93af5sbo\sloth\
mrgloom commented 6 years ago

Looks like on PyPi we have onother package with same name https://pypi.python.org/pypi/SLOTH/ https://github.com/cvhciKIT/sloth/issues/99

mrgloom commented 6 years ago

Finally I runned it on Windows and anaconda python 2, like : python sloth/bin/sloth examples/example1_labels.json

https://github.com/cvhciKIT/sloth/issues/92