nneonneo / sha1collider

Build two PDFs that have different content but identical SHA1 sums.
412 stars 70 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'gs' #4

Closed touatily closed 4 years ago

touatily commented 4 years ago

I got this error when runing collide.py :

[16:09:42] INFO: rendering file 1...
Traceback (most recent call last):
  File "collide.py", line 314, in <module>
    exit(main(sys.argv[1:]))
  File "collide.py", line 308, in main
    doit(outdir, args)
  File "collide.py", line 210, in doit
    subprocess.check_call(['gs', '-r%d' % args.resolution, '-sDEVICE=png16m',
  File "/usr/local/lib/python3.8/subprocess.py", line 359, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/local/lib/python3.8/subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/local/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'gs'
nneonneo commented 4 years ago

You need to install GhostScript.

Robert

On Apr 25, 2020, at 7:11 AM, Lyes Touati notifications@github.com wrote:

 I got this error when runing collide.py :

[16:09:42] INFO: rendering file 1... Traceback (most recent call last): File "collide.py", line 314, in exit(main(sys.argv[1:])) File "collide.py", line 308, in main doit(outdir, args) File "collide.py", line 210, in doit subprocess.check_call(['gs', '-r%d' % args.resolution, '-sDEVICE=png16m', File "/usr/local/lib/python3.8/subprocess.py", line 359, in check_call retcode = call(*popenargs, *kwargs) File "/usr/local/lib/python3.8/subprocess.py", line 340, in call with Popen(popenargs, **kwargs) as p: File "/usr/local/lib/python3.8/subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'gs' — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

N2Lgf commented 4 years ago

I'm having a similar issue, but I have GhostScript installed, also tried in the Ubuntu 16.04, besides kali, but they all give some kind of error. (ubuntu 20.04) like this:

[03:29:51] INFO: rendering file 1... GPL Ghostscript 9.50 (2019-10-15) Copyright (C) 2019 Artifex Software, Inc. All rights reserved. This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY: see the file COPYING for details. Error: /undefined in RIFF Operand stack:

Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1990 1 3 %oparray_pop 1989 1 3 %oparray_pop 1977 1 3 %oparray_pop 1833 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- Dictionary stack: --dict:731/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)-- Current allocation mode is local Current file position is 4 GPL Ghostscript 9.50: Unrecoverable error, exit code 1 Traceback (most recent call last): File "collide.py", line 317, in exit(main(sys.argv[1:])) File "collide.py", line 311, in main doit(outdir, args) File "collide.py", line 213, in doit subprocess.check_call(['gs', '-r%d' % args.resolution, '-sDEVICE=png16m', File "/usr/lib/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['gs', '-r300', '-sDEVICE=png16m', '-o', '/tmp/tmp1u3stfwl/t1-%04d.png', 'gato.pdf']' returned non-zero exit status 1.

nneonneo commented 4 years ago

Is gato.pdf actually a PDF file? What does file gato.pdf produce?

N2Lgf commented 4 years ago

I downloaded gato as a .jpeg, but saved as .pdf, is it wrong to do that? file gato.pdf: gato.pdf: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 225x225, components 3

N2Lgf commented 4 years ago

I am sorry. I have converted the .jpeg images to .pdf as I have should done since the beginning. Then ocurred a "cjpeg" error, so I apt install libjpeg-turbo-progs, and finally got it right. Thank you.