我正在尝试在mac机器Torch7中安装。当我尝试使用本教程https://github.com/torch/torch7/wiki/Cheatsheet#installing-and-running-torch在第二行(curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-luajit+torch | bash)上安装火炬时,我遇到以下错误:
- 寻找QT_MAC_USE_COCOA - 找到了 /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:108中的CMake错误(消息): 找不到Qt4(缺少:QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE)(找到合适的版本" 4.7.4",最低要求是 " 4.3.0&#34) 呼叫堆栈(最近一次呼叫): /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:315(_FPHSA_FAILURE_MESSAGE) /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindQt4.cmake:1393(FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:27(FIND_PACKAGE)
你以前遇到过这个问题吗? 感谢
答案 0 :(得分:6)
按照https://github.com/torch/ezinstall的建议运行curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-all | bash
后,我收到同样的错误,即
Could NOT find Qt4 (missing:
QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE
QT_UIC_EXECUTABLE) (found suitable version "4.8.6", minimum required is
"4.3.0")
当我跑which qmake
时,我发现qmake位于~/anaconda/bin/qmake
。我尝试了很多不同的方法来正确设置QT_MOC_EXECUTABLE
,QT_RCC_EXECUTABLE
和QT_UIC_EXECUTABLE
路径,例如。
qmake -set "QT_MOC_EXECUTABLE" /usr/local/Cellar/qt/4.8.6/bin/moc
qmake -set "QT_RCC_EXECUTABLE" /usr/local/Cellar/qt/4.8.6/bin/rcc
qmake -set "QT_UIC_EXECUTABLE" /usr/local/Cellar/qt/4.8.6/bin/uic
但没有任何效果。
所以我做的是通过rm -rf ~/anaconda
我再次运行curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-all | bash
,一切都正确安装。然后我就重新安装了anaconda。
这是一种解脱。它可能不是最好的解决方案,但我希望这对你也有用。