2015-12-17 107 views
7

我在我的系統中安裝opencv下面給出的命令打開cv http://docs.opencv.org/2.4/doc/tutorials/introduction/ios_install/ios_install.html 我得到這個錯誤請讓我知道我缺少什麼。OPEN CV iOS安裝

anil-Mac-2s-Mac-mini:opencv pws-mac-2$ python platforms/ios/build_framework.py ios 
Executing: ['cmake', '-GXcode', '-DCMAKE_BUILD_TYPE=Release', '-DCMAKE_TOOLCHAIN_FILE=/Users/pws-mac-2/Desktop/opencv/platforms/ios/cmake/Toolchains/Toolchain-iPhoneOS_Xcode.cmake', '-DCMAKE_INSTALL_PREFIX=install', '-DENABLE_NEON=ON', '/Users/pws-mac-2/Desktop/opencv', '-DCMAKE_C_FLAGS=-fembed-bitcode', '-DCMAKE_CXX_FLAGS=-fembed-bitcode'] in /Users/pws-mac-2/Desktop/opencv/ios/build/armv7-iPhoneOS 

============================================================ 
ERROR: [Errno 2] No such file or directory 
============================================================ 
Traceback (most recent call last): 
File "platforms/ios/build_framework.py", line 183, in <module> 
b.build(args.out) 
File "platforms/ios/build_framework.py", line 87, in build 
self.buildOne(t[0], t[1], mainBD, cmake_flags) 
File "platforms/ios/build_framework.py", line 105, in buildOne 
execute(cmakecmd, cwd = builddir) 
File "platforms/ios/build_framework.py", line 34, in execute 
retcode = check_call(cmd, cwd = cwd) 
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 535, in check_call 
retcode = call(*popenargs, **kwargs) 
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call 
return Popen(*popenargs, **kwargs).wait() 
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__ 
errread, errwrite) 
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child 
raise child_exception 
OSError: [Errno 2] No such file or directory 

我收到此錯誤,請讓我知道如何解決。 。 。

+0

什麼在OpenCV的目錄?你確定文件存在嗎? – Nour

+0

是存在的文件。 。我已經手動檢查過 –

+0

@nour問題編輯請現在檢查 –

回答

16

發生此錯誤是因爲cmake(a)未安裝或(b)不在用戶的路徑上。

在這種情況下,OP已經下載的cmake GUI應用程序from cmake.org,並將其複製到/Applications。此應用程序不會自動添加路徑到二進制文件,這就是爲什麼腳本找不到cmake

通過添加路徑CMake的二進制文件(bash的語法):

PATH=$PATH:/Applications/CMake.app/Contents/bin 

的OP能夠成功建立OpenCV的。

大多數軟件包管理器 - 例如homebrewmacports會自動添加一條路徑到用戶的配置文件,這將允許它運行而不必修改路徑。

+1

謝謝!所以'brew install cmake'會起作用。 – Awesomeness

2

您可能需要安裝CMake

My-Mac: opencv$ brew install cmake