OSError:[WinError 193]%1不是有效的Win32应用程序opencv.js [英] OSError: [WinError 193] %1 is not a valid Win32 application opencv.js
本文介绍了OSError:[WinError 193]%1不是有效的Win32应用程序opencv.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试从 opencv.js 。 htmlrel =nofollow noreferrer>教程在他们的页面上。
I have tried to build opencv.js
from the tutorial on their page.
我已经完成了除最后一个步骤之外的所有步骤来构建它:
I have done all the steps except the last one to build it:
C:\Users\student>python C:\Users\student\opencv\platforms\js\build_js.py documents
这给了我这个错误:
Args: Namespace(build_dir='documents', build_doc=False, build_test=False, build_wasm=False, clean_build_dir=False, config_only=False, emscripten_dir=None, enable_exception=False, opencv_dir='C:\\Users\\student\\opencv', skip_config=False)
Cannot get Emscripten path, please specify it either by EMSCRIPTEN environment variable or --emscripten_dir option.
我尝试使用它然后
C:\Users\student>python C:\Users\student\opencv\platforms\js\build_js.py --emscripten=C:\Users\student\emsdk\emscripten\1.37.36 documents
- emscripten
选项,但我得到了这个:
with the --emscripten
option but I got this instead:
Args: Namespace(build_dir='documents', build_doc=False, build_test=False, build_wasm=False, clean_build_dir=False, config_only=False, emscripten_dir='C:\\Users\\student\\emsdk\\emscripten\\1.37.36', enable_exception=False, opencv_dir='C:\\Users\\student\\opencv', skip_config=False)
Check dir C:\Users\student\documents (create: True, clean: False)
Check dir C:\Users\student\opencv (create: False, clean: False)
Check dir C:\Users\student\emsdk\emscripten\1.37.36 (create: False, clean: False)
Traceback (most recent call last):
File "C:\Users\student\opencv\platforms\js\build_js.py", line 215, in <module>
builder = Builder(args)
File "C:\Users\student\opencv\platforms\js\build_js.py", line 84, in __init__
self.emcc_version = determine_emcc_version(self.emscripten_dir)
File "C:\Users\student\opencv\platforms\js\build_js.py", line 62, in determine_emcc_version
ret = subprocess.check_output([os.path.join(emscripten_dir, "emcc"), "--version"])
File "C:\Users\student\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Users\student\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\student\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "C:\Users\student\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 997, in _execute_child
startupinfo)
OSError: [WinError 193] %1 is not a valid Win32 application
我已经搜索了这个问题差不多2天但没有解决它。
I have searched for this problem for almost 2 days but nothing solve it.
我正在使用Windows 10 64位。
I'm using Windows 10 64bit.
推荐答案
打开 opencv\platforms\js\build_js.py
文件,并替换此行:
Open opencv\platforms\js\build_js.py
file, and replace this line:
ret = subprocess.check_output([os.path.join(emscripten_dir, "emcc"), "--version"])
这个:
ret = subprocess.check_output([os.path.join(emscripten_dir, "emcc.bat"), "--version"])
希望这将在下一个opencv版本中修复。
Hope this will be fixed in next opencv version.
这篇关于OSError:[WinError 193]%1不是有效的Win32应用程序opencv.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文