andrewning / sortphotos

SortPhotos is a Python script that organizes photos and videos into folders using date/time information

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running script on Synology NAS DS214play

pankrusheff opened this issue · comments

I’ve tried to setup your script to my synology NAS
setup steps:

  1. Python. through repo of synology
  2. Setuptools. wget https://bootstrap.pypa.io/ez_setup.py -O - | python
  3. SortPhotos. python setup.py install
    Than I try to : sortphotos
    EARTH> sortphotos
    usage: sortphotos [-h] [-r] [-c] [-s] [-t] [--sort SORT] [--rename RENAME]
    [--keep-duplicates] [--day-begins DAY_BEGINS]
    [--ignore-groups IGNORE_GROUPS [IGNORE_GROUPS ...]]
    [--ignore-tags IGNORE_TAGS [IGNORE_TAGS ...]]
    [--use-only-groups USE_ONLY_GROUPS [USE_ONLY_GROUPS ...]]
    [--use-only-tags USE_ONLY_TAGS [USE_ONLY_TAGS ...]]
    src_dir dest_dir
    sortphotos: error: too few arguments
    and i think, nice it work :)
    But when i try to:
    sortphotos /volume1/photo/Backup\ 32/ /volume1/photo/RAW/ --sort %Y/%Y-%m-%b
    errors came true:
    EARTH> sortphotos /volume1/photo/Backup\ 32/ /volume1/photo/RAW/ -r --sort %Y/%Y-%m-%b
    Traceback (most recent call last):
    File "/usr/bin/sortphotos", line 9, in <module>
    load_entry_point('sortphotos==1.0', 'console_scripts', 'sortphotos')()
    File "/usr/lib/python2.7/site-packages/sortphotos-1.0-py2.7.egg/src/sortphotos.py", line 484, in main
    args.use_only_tags, not args.silent)
    File "/usr/lib/python2.7/site-packages/sortphotos-1.0-py2.7.egg/src/sortphotos.py", line 294, in sortPhotos
    with ExifTool(verbose=verbose) as e:
    File "/usr/lib/python2.7/site-packages/sortphotos-1.0-py2.7.egg/src/sortphotos.py", line 187, in __enter__
    stdin=subprocess.PIPE, stdout=subprocess.PIPE)
    File "/usr/lib/python2.7/subprocess.py", line 710, in **init**
    errread, errwrite)
    File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
    OSError: [Errno 2] No such file or directory
    What do i wrong?

You must have perl installed 😊

-----Message d'origine-----
De : "pankrusheff" notifications@github.com
Envoyé : ‎07/‎10/‎2015 01:51
À : "andrewning/sortphotos" sortphotos@noreply.github.com
Objet : [sortphotos] Running script on Synology NAS DS214play (#60)

I’ve tried to setup your script to my synology NAS
setup steps:

  1. Python. through repo of synology
  2. Setuptools. wget https://bootstrap.pypa.io/ezsetup.py -O - | python
  3. SortPhotos. python setup.py install
    Than I try to : sortphotos
    EARTH> sortphotos
    usage: sortphotos [-h] [-r] [-c] [-s] [-t] [--sort SORT] [--rename RENAME]
    [--keep-duplicates] [--day-begins DAY_BEGINS]
    [--ignore-groups IGNORE_GROUPS [IGNORE_GROUPS ...]]
    [--ignore-tags IGNORE_TAGS [IGNORE_TAGS ...]]
    [--use-only-groups USE_ONLY_GROUPS [USE_ONLY_GROUPS ...]]
    [--use-only-tags USE_ONLY_TAGS [USE_ONLY_TAGS ...]]
    src_dir dest_dir
    sortphotos: error: too few arguments
    and i think, nice it work :)
    But when i try to:
    sortphotos /volume1/photo/Backup\ 32/ /volume1/photo/RAW/ --sort %Y/%Y-%m-%b
    errors came true:
    EARTH> sortphotos /volume1/photo/Backup\ 32/ /volume1/photo/RAW/ -r --sort %Y/%Y-%m-%b
    Traceback (most recent call last):
    File "/usr/bin/sortphotos", line 9, in
    load_entry_point('sortphotos==1.0', 'console_scripts', 'sortphotos')()
    File "/usr/lib/python2.7/site-packages/sortphotos-1.0-py2.7.egg/src/sortphotos.py", line 484, in main
    args.use_only_tags, not args.silent)
    File "/usr/lib/python2.7/site-packages/sortphotos-1.0-py2.7.egg/src/sortphotos.py", line 294, in sortPhotos
    with ExifTool(verbose=verbose) as e:
    File "/usr/lib/python2.7/site-packages/sortphotos-1.0-py2.7.egg/src/sortphotos.py", line 187, in __enter_ stdin=subprocess.PIPE, stdout=subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 710, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory
    What do i wrong?

    Reply to this email directly or view it on GitHub.

Sorry I'm little dumb in this case :)
As far as i know, Perl is installed on Synology Base setup.
How do I check it?

Отправлено с iPhone

7 окт. 2015 г., в 13:48, nekopep notifications@github.com написал(а):

You must have perl installed 😊

-----Message d'origine-----
De : "pankrusheff" notifications@github.com
Envoyé : ‎07/‎10/‎2015 01:51
À : "andrewning/sortphotos" sortphotos@noreply.github.com
Objet : [sortphotos] Running script on Synology NAS DS214play (#60)

I’ve tried to setup your script to my synology NAS
setup steps:

  1. Python. through repo of synology
  2. Setuptools. wget https://bootstrap.pypa.io/ezsetup.py -O - | python
  3. SortPhotos. python setup.py install
    Than I try to : sortphotos
    EARTH> sortphotos
    usage: sortphotos [-h] [-r] [-c] [-s] [-t] [--sort SORT] [--rename RENAME]
    [--keep-duplicates] [--day-begins DAY_BEGINS]
    [--ignore-groups IGNORE_GROUPS [IGNORE_GROUPS ...]]
    [--ignore-tags IGNORE_TAGS [IGNORE_TAGS ...]]
    [--use-only-groups USE_ONLY_GROUPS [USE_ONLY_GROUPS ...]]
    [--use-only-tags USE_ONLY_TAGS [USE_ONLY_TAGS ...]]
    src_dir dest_dir
    sortphotos: error: too few arguments
    and i think, nice it work :)
    But when i try to:
    sortphotos /volume1/photo/Backup\ 32/ /volume1/photo/RAW/ --sort %Y/%Y-%m-%b
    errors came true:
    EARTH> sortphotos /volume1/photo/Backup\ 32/ /volume1/photo/RAW/ -r --sort %Y/%Y-%m-%b
    Traceback (most recent call last):
    File "/usr/bin/sortphotos", line 9, in
    load_entry_point('sortphotos==1.0', 'console_scripts', 'sortphotos')()
    File "/usr/lib/python2.7/site-packages/sortphotos-1.0-py2.7.egg/src/sortphotos.py", line 484, in main
    args.use_only_tags, not args.silent)
    File "/usr/lib/python2.7/site-packages/sortphotos-1.0-py2.7.egg/src/sortphotos.py", line 294, in sortPhotos
    with ExifTool(verbose=verbose) as e:
    File "/usr/lib/python2.7/site-packages/sortphotos-1.0-py2.7.egg/src/sortphotos.py", line 187, in __enter_ stdin=subprocess.PIPE, stdout=subprocess.PIPE) File "/usr/lib/python2.7/subprocess.py", line 710, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory
    What do i wrong?

    Reply to this email directly or view it on GitHub.

    Reply to this email directly or view it on GitHub.

I'm not sure, perhpas typing perl on the ssh console?
I had the same issue on windows and had to install perl.

perl -v

This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail) Copyright 1987-2013, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page.

I think perl on board :)
Any other ideas?

If you take a look at line 187, the script try to execute:
perl "self.executable" -stay_open True -@ -
with self.executable = exiftool_location
exiftool_location = os.path.join(os.path.dirname(os.path.realpath(file)), 'Image-ExifTool', 'exiftool')

So try to run #perl Image-ExifTool/exiftool and you will will probably see an error (in the src/ directory)

Could this be due to the fact that I installed incorrectly sortphotos ?
How do it right in Synology?

Can you launch exiftool by hand? (perl exiftool)
Personnally I tun the script directly from source file without doing setup.py.

Le 7 oct. 2015 à 22:48, pankrusheff notifications@github.com a écrit :

Could this be due to the fact that I installed incorrectly sortphotos ?
How do it right in Synology?


Reply to this email directly or view it on GitHub #60 (comment).

EARTH> perl exiftool
-ash: perl: not found

Hmm... Strange((( where is perl?

I encounter similar error on my QNAP NAS?
Anyone can help on this?

Resolved, Add perl path to shell will do.

Traceback (most recent call last):
  File "sortphotos.py", line 487, in <module>
    main()
  File "sortphotos.py", line 484, in main
    args.use_only_tags, not args.silent)
  File "sortphotos.py", line 294, in sortPhotos
    with ExifTool(verbose=verbose) as e:
  File "sortphotos.py", line 187, in __enter__
    stdin=subprocess.PIPE, stdout=subprocess.PIPE)
  File "/share/CACHEDEV1_DATA/.qpkg/Python/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/share/CACHEDEV1_DATA/.qpkg/Python/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

[/share/homes/sxchan/sortphotos-master/src] # head -n 187 sortphotos.py | tail -5

def __enter__(self):
    self.process = subprocess.Popen(
        ['perl', self.executable, "-stay_open", "True",  "-@", "-"],
        stdin=subprocess.PIPE, stdout=subprocess.PIPE)