pip install zxing
之后使用
zxing 1.png
报错:
Traceback (most recent call last):
File "c:\software\python\install\lib\runpy.py", line 193, in run_module_as_main
"_main
", mod_spec)
File "c:\software\python\install\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\software\python\install\Scripts\zxing.exe_main
.py", line 9, in <module>
File "c:\software\python\install\lib\site-packages\zxing_main_.py", line 24, in main
bc = bcr.decode(fn, try_harder=args.try_harder)
File "c:\software\python\install\lib\site-packages\zxing_init_.py", line 37, in decode
p = sp.Popen(cmd, stdout=sp.PIPE, universal_newlines=False)
File "c:\software\python\install\lib\subprocess.py", line 775, in init
restore_signals, start_new_session)
File "c:\software\python\install\lib\subprocess.py", line 1178, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。</module>

原因是zxing要调用一些java文件,要求java文件可被执行。
解决办法:安装java(jdk、jre都可以)。

安装之后再运行:
1.png
=====
Decoded None barcode in None format.
Raw text: ''
Parsed text: ''