pip install zxing 出错解决

pip install zxing

之后使用

zxing 1.png

报错:

Traceback (most recent call last):
  File "c:softwarepythoninstalllib
unpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:softwarepythoninstalllib
unpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:softwarepythoninstallScriptszxing.exe\__main__.py", line 9, in <module>
  File "c:softwarepythoninstalllibsite-packageszxing\__main__.py", line 24, in main
    bc = bcr.decode(fn, try_harder=args.try_harder)
  File "c:softwarepythoninstalllibsite-packageszxing\__init__.py", line 37, in decode
    p = sp.Popen(cmd, stdout=sp.PIPE, universal_newlines=False)
  File "c:softwarepythoninstalllibsubprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "c:softwarepythoninstalllibsubprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] 系统找不到指定的文件。

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

安装之后再运行: zxing 1.png

  Decoded None barcode in None format.
  Raw text:    ''
  Parsed text: ''

记得要把java加入到环境变量

文章目录