dlenski / python-zxing

python wrapper for the ZXing barcode library
GNU Lesser General Public License v3.0
123 stars 37 forks source link

[WinError 2] The system cannot find the file specified #3

Closed UT1 closed 4 years ago

UT1 commented 4 years ago

Tried implmenting it on a windows platform.Found this error after following the error

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-14-57bf31b8a763> in <module>
----> 1 text = reader.decode("ad1.jpg")

~\AppData\Local\Continuum\anaconda3\lib\site-packages\zxing\__init__.py in decode(self, filename, try_harder, possible_formats)
     35                 cmd += ['--possible_formats', pf ]
     36 
---> 37         p = sp.Popen(cmd, stdout=sp.PIPE, universal_newlines=False)
     38         stdout, stderr = p.communicate()
     39 

~\AppData\Local\Continuum\anaconda3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, encoding, errors, text)
    773                                 c2pread, c2pwrite,
    774                                 errread, errwrite,
--> 775                                 restore_signals, start_new_session)
    776         except:
    777             # Cleanup if the child failed starting.

~\AppData\Local\Continuum\anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_start_new_session)
   1176                                          env,
   1177                                          os.fspath(cwd) if cwd is not None else None,
-> 1178                                          startupinfo)
   1179             finally:
   1180                 # Child is launched. Close the parent's copy of those pipe

FileNotFoundError: [WinError 2] The system cannot find the file specified
dlenski commented 4 years ago

Tried implmenting it on a windows platform.Found this error after following the error

How did you install it?

Does it work if you explicitly specify the path to the Java binary with --java c:\wherever\java\is\installed\java.exe?

dlenski commented 4 years ago

Please try latest version, which gives more comprehensible error messages when attempting to call the Java binary, or interacting with the ZXing Java library.